:root {
  --dark: #1f2937;
  --primary: #c75842;
  --light: #f8fafc;
  --white: #ffffff;
  --text: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  background: var(--dark);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo,
nav a {
  color: var(--white);
  text-decoration: none;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero {
  padding: 7rem 0;
  color: var(--white);
  background-image: url("../images/home2.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.1;
}

.hero p {
  max-width: 650px;
  font-size: 1.15rem;
}

/* Homepage project video */

.project-video-section {
  padding: 4rem 0;
  background: var(--light);
  text-align: center;
}

.project-video-section h2 {
  margin-top: 0;
}

.project-video-intro {
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.project-video-wrap {
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--dark);
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
}

.project-video {
  display: block;
  width: 100%;
  height: auto;
}

.project-video-gallery-link {
  margin-top: 2rem;
}

.project-video-gallery-link p {
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.project-video-gallery-link .back-link {
  margin-bottom: 0;
}

.button {
  display: block;
  width: max-content;
  margin: 1rem auto 0;
  padding: 0.8rem 1.1rem;
  color: var(--white);
  background: var(--primary);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: #a94735;
}

.button:focus-visible {
  outline: 3px solid rgba(199, 88, 66, 0.4);
  outline-offset: 3px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 2rem 0 4rem;
}

.card {
  padding: 1.5rem;
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--white);
}

.card h3 {
  margin-top: 0;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

.site-footer {
  padding: 2rem 0;
  color: var(--white);
  background: var(--dark);
}

.site-footer a {
  color: var(--white);
}

/* Contact page */

.page-hero {
  min-height: 420px;
  padding: 6rem 0;
  color: var(--white);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-align: center;
  display: flex;
  align-items: center;
}

.page-hero .container {
  width: min(1100px, 92%);
}

.contact-hero {
  background-position: center 60%;
  background-image:
    linear-gradient(
      rgba(95, 39, 28, 0.35),
      rgba(199, 88, 66, 0.30)
    ),
    url("../images/contact-staircase.jpeg");
}

.page-hero h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.1;
}

.page-hero p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.15rem;
}

.contact-section {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-details h2,
.contact-form-wrap h2 {
  margin-top: 0;
}

.contact-details a {
  color: var(--primary);
  font-weight: 700;
}

.contact-note {
  margin-top: 2rem;
  padding: 1rem;
  border-left: 4px solid var(--primary);
  background: var(--light);
}

.contact-form-wrap {
  padding: 1.5rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: var(--light);
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem;
  color: var(--text);
  border: 1px solid #9ca3af;
  border-radius: 5px;
  font: inherit;
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid rgba(199, 88, 66, 0.25);
  border-color: var(--primary);
}

.required-note {
  margin-top: 0;
  font-size: 0.9rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

/* Services page */

.services-hero {
  background-image:
    linear-gradient(
      rgba(95, 39, 28, 0.35),
      rgba(199, 88, 66, 0.30)
    ),
    url("../images/services-sanding.jpeg");
}

.services-intro {
  max-width: 850px;
  padding-top: 3rem;
  padding-bottom: 1rem;
}

.services-intro h2 {
  margin-top: 0;
  text-align: center;
}

.services-section {
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 1.5rem;
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--white);
}

.service-card h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1.25;
  text-align: center;
}

.service-card ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.estimate-section {
  padding: 4rem 0;
  color: var(--white);
  background: var(--dark);
  text-align: center;
}

.estimate-section h2 {
  margin-top: 0;
}

.estimate-section p {
  max-width: 700px;
  margin: 0 auto;
}

.estimate-section .button {
  background: var(--primary);
}

.estimate-section .button:hover,
.estimate-section .button:focus-visible {
  background: #a94735;
}
  
  /* About page */
  
.about-hero {
  background-position: center 55%;
  background-image:
    linear-gradient(
      rgba(31, 41, 55, 0.84),
      rgba(31, 41, 55, 0.66)
    ),
    url("../images/about-david-working.jpg");
}

.about-intro {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-grid h2 {
  margin-top: 0;
}

.experience-box {
  padding: 2rem;
  color: var(--text);
  background: var(--light);
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  text-align: center;
}

.experience-number {
  margin: 0;
  color: var(--primary);
  font-size: clamp(3.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1;
}

.experience-label {
  margin: 0.75rem 0 1.5rem;
  font-weight: 700;
}

.about-values {
  padding: 4rem 0;
  background: var(--light);
}

.about-values h2 {
  margin-top: 0;
  text-align: center;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.value-card {
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
}

.value-card h3 {
  margin-top: 0;
  color: var(--primary);
  text-align: center;
}

.value-card p {
  margin-bottom: 0;
}

.who-we-serve {
  max-width: 850px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.who-we-serve h2 {
  margin-top: 0;
}

.who-we-serve ul {
  padding-left: 1.25rem;
}

/* Gallery page */

.gallery-hero {
  background-image:
    linear-gradient(
      rgba(31, 41, 55, 0.82),
      rgba(95, 39, 28, 0.72)
    );
}

.gallery-intro {
  max-width: 850px;
  padding-top: 3.5rem;
  padding-bottom: 2rem;
  text-align: center;
}

.gallery-intro h2 {
  margin-top: 0;
}

.gallery-note {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 4px solid var(--primary);
  background: var(--light);
  text-align: left;
}

.project-gallery {
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.gallery-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: var(--white);
}

.gallery-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.gallery-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-dialog {
  width: min(1100px, 92vw);
  max-width: none;
  max-height: 92vh;
  margin: auto;
  padding: 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: var(--white);
}

.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.dialog-caption {
  margin: 0.75rem 2.5rem 0;
  text-align: center;
  font-weight: 700;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: auto;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.dialog-close:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.gallery-item figcaption {
  padding: 0.9rem 1rem;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

/* Featured projects callout */

.featured-projects-section {
  padding: 4rem 0;
  background: var(--light);
  text-align: center;
}

.featured-projects-section h2 {
  margin-top: 0;
}

.featured-projects-section p {
  max-width: 700px;
  margin: 0 auto;
}

.featured-projects-section .button {
  margin-top: 1.5rem;
}

/* Featured projects page */

.featured-projects-hero {
  background-image:
    linear-gradient(
      rgba(31, 41, 55, 0.84),
      rgba(95, 39, 28, 0.72)
    );
}

.featured-projects-intro {
  max-width: 850px;
  padding-top: 3.5rem;
  padding-bottom: 2rem;
}

.featured-projects-intro h2 {
  margin-top: 0;
}

.featured-projects-list {
  display: grid;
  gap: 2.5rem;
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.featured-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--white);
}

.featured-project-image {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--dark);
}

.featured-project-image img {
  display: block;
  width: 100%;
  min-height: 330px;
  object-fit: cover;
}

.featured-project-image figcaption {
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--dark);
  font-size: 0.9rem;
  text-align: center;
}

.featured-project-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
}

.project-type {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.featured-project-content h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1.2;
}

.featured-project-content .button {
  margin: auto 0 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.project-tags li {
  padding: 0.3rem 0.65rem;
  color: var(--text);
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: var(--light);
  font-size: 0.85rem;
  font-weight: 700;
}

.featured-project-end {
  text-align: center;
}

/* Individual featured project pages */

.project-hero {
  background-image:
    linear-gradient(
      rgba(31, 41, 55, 0.84),
      rgba(95, 39, 28, 0.72)
    );
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-overview {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-summary-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.project-summary-grid h2,
.project-facts h2 {
  margin-top: 0;
}

.project-facts {
  padding: 1.5rem;
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--light);
}

.project-facts dl {
  margin: 0;
}

.project-facts dl div + div {
  margin-top: 1rem;
}

.project-facts dt {
  color: var(--primary);
  font-weight: 700;
}

.project-facts dd {
  margin: 0.15rem 0 0;
}

.project-before-after {
  padding: 4rem 0;
  background: var(--light);
}

.project-before-after h2,
.project-photo-section h2 {
  margin-top: 0;
  text-align: center;
}

.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.before-after-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--white);
}

.before-after-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.before-after-grid figcaption {
  padding: 0.9rem 1rem;
  font-weight: 700;
  text-align: center;
}

.project-photo-section {
  padding: 4rem 0;
}

.project-photo-section h2 {
  margin: 0 0 2rem;
  text-align: center;
}

.project-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.project-photo-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--white);
}

.project-photo-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-photo-card figcaption {
  padding: 0.9rem 1rem;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

/* Full-size project image viewer */

.project-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.project-image-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.project-image-button img {
  display: block;
  width: 100%;
}

.project-image-dialog {
  width: min(1400px, 94vw);
  max-width: none;
  max-height: 94vh;
  margin: auto;
  padding: 0.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
}

.project-image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.project-image-dialog img {
  display: block;
  width: 100%;
  max-height: 84vh;
  object-fit: contain;
}

.project-dialog-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: auto;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 2.25rem;
  line-height: 1;
}

.project-dialog-close:hover,
.project-dialog-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.project-dialog-close:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Mobile layout */

@media (max-width: 700px) {
  .site-header .container {
    align-items: flex-start;
    flex-direction: column;
  }
  
nav {
  gap: 0.75rem;
  }

nav a {
  padding: 0.5rem 0;
  }

.cards {
    grid-template-columns: 1fr;
  }

.contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
.service-grid {
    grid-template-columns: 1fr;
  }
  
.about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

.values-grid {
    grid-template-columns: 1fr;
  }
  
.gallery-grid {
    grid-template-columns: 1fr;
  }

.page-hero {
    min-height: 320px;
    padding: 4rem 0;
  }
  
.featured-project-card {
  grid-template-columns: 1fr;
  }
  
  .featured-project-image {
  margin-bottom: 1rem;
}

.featured-project-image img {
  min-height: 240px;
  }

.featured-project-content {
  padding: 1.5rem;
  }
  
  .project-summary-grid,
.before-after-grid,
.project-photo-grid {
  grid-template-columns: 1fr;
  }
}