/* Protech Building & Acoustics - stylesheet */
:root {
  --red: #D42B2B;
  --charcoal: #1F2328;
  --text: #3A4149;
  --alt: #F6F7F9;
  --white: #FFFFFF;
  --footer: #111518;
  --hairline: #E3E6EA;
  --space: 8px;
  --max: 1200px;
  --radius: 4px;
  --gutter: max(calc(var(--space) * 3), calc((100% - var(--max)) / 2));
  --nav-h: 220px;
  --nav-h-solid: 124px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
}
body.has-lightbox { overflow: hidden; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
h1, h2, h3 { color: var(--charcoal); font-weight: 800; line-height: 1.15; margin: 0 0 calc(var(--space) * 2); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 calc(var(--space) * 2); }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--charcoal); }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Nav ---------- */
#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--space) * 1.5) var(--gutter);
  color: #fff;
  background: transparent;
  transition: background-color 160ms, box-shadow 160ms;
}
#site-nav .logo { display: block; color: inherit; line-height: 0; }
#site-nav .logo:hover { color: inherit; }
#site-nav .logo svg { height: 192px; width: auto; display: block; transition: height 160ms; }
#site-nav.is-solid .logo svg, html:not(.js) #site-nav .logo svg { height: 96px; }
#nav-links { display: flex; gap: calc(var(--space) * 4); }
#nav-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space) 0;
  border-bottom: 2px solid transparent;
}
#nav-links a:hover { border-bottom-color: var(--red); color: inherit; }
#nav-toggle {
  display: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  padding: var(--space) calc(var(--space) * 2);
  min-height: 44px;
  cursor: pointer;
}
#site-nav.is-solid { background: var(--white); color: var(--charcoal); box-shadow: 0 1px 0 var(--hairline); }
#site-nav.is-solid .logo { color: var(--red); }

@media (max-width: 899px) {
  #site-nav { padding-top: var(--space); padding-bottom: var(--space); }
  :root { --nav-h: 92px; }
  #site-nav .logo svg, #site-nav.is-solid .logo svg { height: 72px; }
  #nav-toggle { display: inline-block; }
  #nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--space) calc(var(--space) * 3) calc(var(--space) * 2);
    background: var(--charcoal);
    color: #fff;
  }
  #nav-links.is-open { display: flex; }
  #nav-links a { display: block; padding: calc(var(--space) * 1.5) 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  #site-nav.is-solid #nav-links { background: var(--white); color: var(--charcoal); box-shadow: 0 1px 0 var(--hairline); }
  #site-nav.is-solid #nav-links a { border-bottom-color: var(--hairline); }
}

/* No-JS fallback: solid, in-flow nav with links shown inline (main.js adds .js to <html>) */
html:not(.js) #site-nav {
  position: relative;
  flex-wrap: wrap;
  gap: var(--space);
  background: var(--white);
  color: var(--charcoal);
  box-shadow: 0 1px 0 var(--hairline);
}
html:not(.js) #site-nav .logo { color: var(--red); }
html:not(.js) #nav-toggle { display: none; }
html:not(.js) #nav-links {
  display: flex;
  position: static;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 calc(var(--space) * 3);
  padding: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}
html:not(.js) #nav-links a { display: inline-block; padding: var(--space) 0; border-bottom: 2px solid transparent; }

/* ---------- Hero ---------- */
#top {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + var(--space) * 6) var(--gutter) calc(var(--space) * 10);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(10,14,18,.85), rgba(10,14,18,.45) 60%, rgba(10,14,18,.2)),
    #1F2328 url(../assets/photos/hero-960.jpg) center/cover;
}
@media (min-width: 900px) {
  #top {
    background:
      linear-gradient(90deg, rgba(10,14,18,.85), rgba(10,14,18,.45) 60%, rgba(10,14,18,.2)),
      #1F2328 url(../assets/photos/hero.jpg) center/cover;
  }
}
#top > * { max-width: 640px; }
#top h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; margin-bottom: calc(var(--space) * 3); }
#top p { font-size: 1.125rem; color: rgba(255,255,255,.92); }
#top .hero-actions { display: flex; flex-wrap: wrap; gap: calc(var(--space) * 2); margin: calc(var(--space) * 2) 0 0; }

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  padding: calc(var(--space) * 2) calc(var(--space) * 4);
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: background-color 160ms, color 160ms, border-color 160ms;
}
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: #B82323; border-color: #B82323; color: #fff; }
.btn-outline { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--charcoal); }

/* ---------- Sections ---------- */
main > section { padding: calc(var(--space) * 12) var(--gutter); }
main > section > h2 { margin-bottom: calc(var(--space) * 5); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--space) * 3);
  text-align: center;
  background: var(--charcoal);
  padding-top: calc(var(--space) * 6) !important;
  padding-bottom: calc(var(--space) * 6) !important;
}
.stats strong { display: block; color: #fff; font-weight: 800; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.1; }
.stats span { display: block; margin-top: var(--space); color: #C5CBD2; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.stats a { color: #fff; }
.stats a:hover { color: #fff; text-decoration-color: var(--red); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--space) * 4); }
.card { padding: calc(var(--space) * 4) 0 0; border-top: 3px solid var(--red); }
.card svg { width: 40px; height: 40px; color: var(--red); margin-bottom: calc(var(--space) * 2); }
.card p { margin: 0; }

#gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space); }
#gallery li { position: relative; min-height: 0; overflow: hidden; border-radius: var(--radius); background: var(--alt); }
#gallery li:not(:nth-child(1)):not(:nth-child(4)) { aspect-ratio: 1 / 1; }
#gallery li:nth-child(1), #gallery li:nth-child(4) { grid-row: span 2; }
#gallery a { display: block; position: absolute; inset: 0; }
#gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 160ms; }
#gallery a:hover img { transform: scale(1.03); }
#gallery a:focus-visible { outline: none; }
#gallery li:has(a:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }

#about { background: var(--alt); }
.about-body { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--space) * 6); align-items: center; }
.about-body p { margin: 0; font-size: 1.0625rem; }
.about-body img { width: 100%; border-radius: var(--radius); object-fit: cover; aspect-ratio: 3 / 2; }

#contact { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--space) * 8); align-content: start; grid-template-rows: repeat(5, auto) 1fr; }
#contact > h2 { grid-column: 1 / -1; }
#contact > p { grid-column: 1; }
#contact > p:nth-of-type(1) { font-size: 1.5rem; font-weight: 800; }
#contact > p:nth-of-type(1) a { color: var(--charcoal); text-decoration: none; }
#contact > p:nth-of-type(1) a:hover { color: var(--red); }
#quote-form { grid-column: 2; grid-row: 2 / 7; display: grid; gap: calc(var(--space) * 2); align-content: start; }
#quote-form label { display: block; font-weight: 700; font-size: 0.875rem; color: var(--charcoal); margin-bottom: var(--space); }
#quote-form input, #quote-form textarea, #quote-form select {
  width: 100%;
  font: inherit;
  color: var(--charcoal);
  background: #fff;
  border: 1px solid #C9CED4;
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
}
#quote-form textarea { min-height: 140px; resize: vertical; }
#quote-form input:focus-visible, #quote-form textarea:focus-visible, #quote-form select:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-color: var(--red); }
#quote-form button { cursor: pointer; font: inherit; }
.hp { position: absolute; left: -9999px; }
.thanks { max-width: 640px; margin: 0 auto; text-align: center; padding: calc(var(--nav-h-solid) + var(--space) * 12) calc(var(--space) * 3) calc(var(--space) * 12); min-height: 70vh; }
.thanks a[href^="tel"] { white-space: nowrap; }
.thanks h1 { font-size: clamp(2rem, 5vw, 3rem); }

footer { background: var(--footer); color: #B4BBC3; padding: calc(var(--space) * 5) var(--gutter); font-size: 0.875rem; display: flex; align-items: center; justify-content: space-between; gap: calc(var(--space) * 3); flex-wrap: wrap; }
footer p { margin: 0; }
footer .flag { height: 40px; width: auto; display: block; border-radius: 2px; }

/* ---------- Lightbox ---------- */
#lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  background: transparent;
  color: #fff;
  opacity: 0;
  transition: opacity 160ms;
}
#lightbox[open] { display: flex; align-items: center; justify-content: center; position: fixed; inset: 0; opacity: 1; }
@starting-style { #lightbox[open] { opacity: 0; } }
#lightbox::backdrop { background: rgba(0,0,0,.92); }
#lightbox img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain; }
#lightbox-close {
  position: absolute;
  top: calc(var(--space) * 2);
  right: calc(var(--space) * 2);
  width: 44px; height: 44px;
  padding: 0;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
#lightbox-close:hover { background: rgba(255,255,255,.15); }
#lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  main > section { padding: calc(var(--space) * 8) var(--gutter); }
  #top { min-height: 80vh; padding-bottom: calc(var(--space) * 8); }
  .stats { grid-template-columns: 1fr; padding-top: calc(var(--space) * 5) !important; padding-bottom: calc(var(--space) * 5) !important; }
  .cards { grid-template-columns: 1fr; gap: calc(var(--space) * 4); }
  #gallery { grid-template-columns: repeat(2, 1fr); }
  .about-body { grid-template-columns: 1fr; gap: calc(var(--space) * 4); }
  #contact { grid-template-columns: 1fr; grid-template-rows: none; }
  #quote-form { grid-column: 1; grid-row: auto; margin-top: calc(var(--space) * 3); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
