
:root{
  --brand-navy:#223A5E;
  --brand-gray:#A8A29E;
  --brand-paper:#F4F3EF;
  --text:#0f172a;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans';color:var(--text)}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}

.container{max-width:1120px;margin:0 auto;padding:0 1rem}

/* Header */
header.topbar{background:var(--brand-navy);color:#fff;position:sticky;top:0;z-index:50}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;padding:.9rem 0}
.brand-logo{height:96px;max-width:100%;object-fit:contain}
.nav{display:flex;gap:1.25rem}
.nav a{color:#fff;font-weight:600;opacity:.95}
.nav a:hover{opacity:1}
@media(max-width:720px){.nav{display:none}}

/* Hero */
.hero{position:relative;padding:5rem 0 6rem;color:#fff;overflow:hidden}
.hero::before{content:"";position:absolute;inset:0;background:url('../images/hero.jpg') center/cover no-repeat;opacity:1}
.hero::after{content:"";position:absolute;inset:0;background:rgba(34,58,94,.62)}
.hero .container{position:relative;z-index:1}
.h1{font-weight:800;line-height:1.08;font-size:2.6rem;margin:0}
@media(min-width:640px){.h1{font-size:3.2rem}}
.craft{color:#e5e7eb}
.sub{margin-top:1rem;color:#edf2f7;font-size:1.05rem;max-width:60ch}
.cta{display:flex;gap:.8rem;flex-wrap:wrap;margin-top:1.5rem}
.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.8rem 1.1rem;border-radius:.8rem;box-shadow:0 1px 2px rgba(0,0,0,.05);transition:.15s}
.btn-primary{background:#ffffff;color:#1e293b}
.btn-ghost{border:1px solid rgba(255,255,255,.35);color:#fff}
.values{margin-top:.8rem;font-weight:700;color:#fff;opacity:.95;font-size:1.05rem}

/*
 * A prominent bar below the hero that showcases the core values. The text is large and
 * bold and sits on a solid navy background. This bar acts as a visual divider
 * between the hero and the services grid. On small screens the font size is
 * slightly reduced to maintain legibility.
 */
.values-bar{
  background:var(--brand-navy);
  color:#fff;
  font-weight:700;
  text-align:center;
  padding:1.2rem 0;
  font-size:2rem;
  line-height:1.2;
}
@media(max-width:640px){
  .values-bar{font-size:1.4rem;}
}
.logo-link{display:inline-flex;align-items:center}
.pills{display:flex;gap:.5rem;margin-top:1rem;flex-wrap:wrap}
.pill{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.25);color:#fff;border-radius:999px;padding:.35rem .7rem;font-size:.9rem}

/* Sections */
.section{padding:3rem 0}
.section.alt{background:var(--brand-paper)}
.h2{font-size:1.9rem;font-weight:800;margin:0 0 .75rem;color:#0f172a}
.grid{display:grid;gap:1rem}
@media(min-width:640px){.grid.s2{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.grid.s3{grid-template-columns:repeat(3,1fr)}}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:1rem;padding:1rem;transition:.15s}
.card:hover{box-shadow:0 6px 16px rgba(0,0,0,.06)}
.muted{color:#475569;font-size:.95rem;line-height:1.6}

/* Service cards for the Services section */
/* Services grid ensures four cards per row on large screens and
 * gracefully collapses down to two cards or one card per row on smaller viewports.
 * A minimum width is applied to the columns on large screens so the cards
 * shrink slightly and appear more compact compared to the previous version.
 */
.services-grid{
  grid-template-columns:repeat(1,1fr);
}
@media(min-width:640px){
  .services-grid{
    grid-template-columns:repeat(2,1fr);
  }
}
@media(min-width:1024px){
  .services-grid{
    grid-template-columns:repeat(4,minmax(200px,1fr));
  }
}

.service-card{
  position:relative;
  border-radius:0.75rem;
  overflow:hidden;
  color:#fff;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  /* Reduce the minimum height of service cards so they appear smaller overall.
   * The aspect ratio is still 1:1, ensuring a square shape on all devices. */
  min-height:150px;
  aspect-ratio:1/1;
  padding:1rem;
}
.service-card h3{
  margin:0 0 .5rem 0;
  font-size:1.2rem;
  font-weight:600;
  position:relative;
  z-index:1;
}
.service-card p{
  margin:0;
  font-size:.875rem;
  display:none;
  margin-top:.5rem;
  position:relative;
  z-index:1;
}

/* reveal description on hover */
.service-card:hover p{
  display:block;
}

/* overlay when hovering over service card */
.service-card::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(17,26,40,0.5);
  opacity:0;
  transition:opacity .3s;
}

.service-card:hover::after{
  opacity:1;
}
.service-card::before{
  content:"";
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center;
  /* darken the background image so that the white text is readable */
  filter:brightness(0.35);
  transition:transform .3s ease;
}
.service-card:hover::before{
  transform:scale(1.05);
}

/*
 * Biography and core values styling for the About section.
 * The about-grid aligns items to the top on larger screens and
 * stacks the columns on smaller viewports via the existing grid.s2 class.
 */
.about-grid{
  align-items:start;
  gap:2rem;
}

/* Bio column styling */
.bio-photo{
  width:100%;
  max-width:280px;
  border-radius:1rem;
  margin-bottom:1rem;
}
.bio h3{
  margin:0;
  font-size:1.4rem;
  color:var(--brand-navy);
}
.bio p{
  margin:.4rem 0;
  line-height:1.5;
}

/* Core values card styling */
.values-card{
  background:var(--brand-paper);
  border:1px solid #e5e7eb;
  border-radius:1rem;
  padding:1.25rem;
}
.values-card h3{
  font-size:1.4rem;
  color:var(--brand-navy);
  font-weight:700;
  margin:0 0 .75rem 0;
}
.values-graphic{
  display:grid;
  gap:1rem;
  grid-template-columns:repeat(1,1fr);
}
@media(min-width:640px){
  .values-graphic{grid-template-columns:repeat(2,1fr);}
}

.value-item{
  display:flex;
  gap:.6rem;
  align-items:flex-start;
}
.value-icon{
  width:64px;
  height:64px;
  min-width:64px;
  min-height:64px;

  width:46px;
  height:46px;
  border-radius:50%;
  background:var(--brand-navy);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:1rem;
  flex:0 0 46px;
  min-width:46px;
  min-height:46px;
}

.value-title{
  font-weight:600;
  color:var(--brand-navy);
  margin-bottom:.1rem;
}

/* Assign background images to each service card.  The images live in assets/images/services */
.service-decks::before{background-image:url('../images/services/decks.jpg');}
.service-remodel::before{background-image:url('../images/services/remodel.jpg');}
.service-flooring::before{background-image:url('../images/services/flooring.jpg');}
.service-siding::before{background-image:url('../images/services/siding.jpg');}
.service-accessibility::before{background-image:url('../images/services/accessibility.jpg');}
.service-painting::before{background-image:url('../images/services/painting.jpg');}
.service-carpentry::before{background-image:url('../images/services/carpentry.jpg');}
.service-and-more::before{background-image:url('../images/services/and-more.jpg');}

/* Why choose us list styling */
.why-list{
  list-style:none;
  line-height:1.6;
  margin:0;
  padding:0;
}
.why-list li{
  position:relative;
  padding-left:1.6rem;
  margin-bottom:.5rem;
}
.why-list li::before{
  /* use a bold check mark icon for each list item */
  content:'\2714';
  position:absolute;
  left:0;
  top:0;
  font-size:1.2rem;
  color:var(--brand-navy);
  font-weight:700;
}

/* Gallery */
.gallery{display:grid;gap:.75rem}
@media(min-width:640px){.gallery{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.gallery{grid-template-columns:repeat(3,1fr)}}
.tile{border:1px solid #e5e7eb;border-radius:.8rem;overflow:hidden;background:#f8fafc;aspect-ratio:4/3}
.tile img{width:100%;height:100%;object-fit:cover}

/* Contact */
.contact{position:relative;color:#fff;overflow:hidden}
.contact::before{content:"";position:absolute;inset:0;background:url('../images/contact-bg.jpg') center/cover no-repeat;opacity:1}
.contact::after{content:"";position:absolute;inset:0;background:rgba(34,58,94,.62)}
.contact .container{position:relative;z-index:1}
.field{border-radius:.8rem;padding:.75rem 1rem;border:none}
.field::placeholder{color:#64748b}

/* Footer */
/*
 * Footer background with subtle image overlay. A semi-transparent layer is
 * applied over the background image to ensure the footer text remains
 * legible. The image itself is defined in the ::before pseudo-element to
 * allow layering without affecting the existing layout.
 */
footer{
  background:#f8fafc;
  color:#475569;
  position:relative;
  overflow:hidden;
}
footer::before{
  content:"";
  position:absolute;
  inset:0;
  background:url('../images/footer-bg.jpg') center/cover no-repeat;
  opacity:0.35;
  z-index:-1;
}
.footer-inner{display:flex;flex-direction:column;gap:1rem;align-items:flex-start;justify-content:space-between;padding:1.25rem 0}
@media(min-width:640px){.footer-inner{flex-direction:row;align-items:center}}

.trust{background:#0f172a0a;border-top:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb}
.trust-inner{display:flex;gap:1rem;justify-content:space-between;align-items:center;padding:1rem 0;flex-wrap:wrap}
.trust-item{color:#0f172a;font-weight:600}
.testimonial-card{border:1px solid #e5e7eb;border-radius:1rem;padding:1.25rem;background:#fff;max-width:860px}
.quote{font-size:1.1rem;line-height:1.6;color:#1f2937;margin:0 0 .5rem}
.author{color:#475569;font-weight:600}
.contact-footer{background:#0f172a;color:#fff}
.contact-footer-inner{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.9rem 0}
.contact-footer-inner a{color:#fff;text-decoration:underline}


/* Service & project modal overlay */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.75);
  z-index:2000;
  align-items:center;
  justify-content:center;
  padding:2rem 1rem;
}
 .modal:target{display:flex;}
.modal.is-open{display:flex;}
.modal-inner{
  width:min(960px, 100%);
  max-height:90vh;
  background:#0b1220;
  border:1px solid rgba(255,255,255,.15);
  border-radius:16px;
  overflow:hidden;
  position:relative;
}
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.25rem;
  color:#fff;
  background:rgba(255,255,255,.04);
}
.modal-close{
  appearance:none;
  border:0;
  background:transparent;
  color:#fff;
  font-size:1.75rem;
  line-height:1;
  cursor:pointer;
}
.carousel{
  display:flex;
  gap:1rem;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  padding:1rem;
  background:#0b1220;
}
.carousel img{
  flex:0 0 100%;
  scroll-snap-align:center;
  max-height:70vh;
  object-fit:contain;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
}
/* Make service cards clickable buttons */
.service-card{
  cursor:pointer;
  border:0;
  background:transparent;
  text-align:left;
}
.service-card:focus-visible{
  outline:3px solid rgba(212,160,23,.6);
  outline-offset:4px;
}


/* === Service Modal Fix === */
.service-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  z-index: 9999;
  padding: 2rem;
}
.service-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-modal .inner {
  max-width: 1100px;
  width: 100%;
}
body.modal-open {
  overflow: hidden;
}


/* === Anchor offset for sticky header === */
html{scroll-behavior:smooth;scroll-padding-top:110px;}
section[id]{scroll-margin-top:110px;}

/* === Service Modals (hash target) === */
.modal.service-modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.85);
  z-index:9999;
  padding:2rem 1rem;
}
.modal.service-modal:target{
  display:flex;
  align-items:center;
  justify-content:center;
}
.modal.service-modal .close{
  position:absolute;
  top:1rem;
  right:1rem;
  font-size:2rem;
  color:#fff;
  text-decoration:none;
}
.modal-inner{
  max-width:1100px;
  width:100%;
  background:rgba(15,23,42,0.15);
  border:1px solid rgba(255,255,255,0.15);
  border-radius:16px;
  padding:1rem;
}
.modal-title{
  color:#fff;
  margin:0 0 .75rem 0;
}
.modal-carousel{
  display:flex;
  gap:1rem;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  padding-bottom:.5rem;
}
.modal-carousel img{
  flex:0 0 100%;
  max-width:100%;
  height:auto;
  border-radius:12px;
  scroll-snap-align:center;
  object-fit:contain;
}
.service-card{cursor:pointer;}


/* === Modal UX: close button + click-out backdrop === */
.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(0,0,0,0.85);
}
.modal:target{
  display: flex;
}
.modal-backdrop{
  position: absolute;
  inset: 0;
}
.modal .close{
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
  z-index: 10000;
}
.modal .close:hover{ background: rgba(255,255,255,0.18); }
.modal img{
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  border-radius: 12px;
}

.service-card h3{ text-shadow: 0 2px 12px rgba(0,0,0,0.55); }
