/* Inner page layouts, image cards, project form, and responsive refinements. */
.page-hero {
  min-height: clamp(370px, 48vw, 590px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
  background:
    linear-gradient(90deg,
      rgba(15, 16, 18, 0.82),
      rgba(15, 16, 18, 0.47) 58%,
      rgba(15, 16, 18, 0.22)),
    var(--page-banner, linear-gradient(135deg, #292629, #61554b)) center/cover no-repeat;
  color: #fff;
}

.page-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 10, 11, 0.22), transparent 45%);
  z-index: -1;
}

.page-hero:after {
  z-index: -1;
  border-color: #ffffff30;
  box-shadow:
    0 0 0 40px #ffffff08,
    0 0 0 90px #ffffff05;
}

.page-hero .eyebrow,
.page-hero>p {
  color: #f0eeec;
}

.page-hero h1,
.page-hero h1 em {
  color: #fff;
}

.page-hero h1 em {
  color: #e4a13b;
}

.page-hero .button {
  align-self: flex-start;
}

.page-hero>* {
  position: relative;
  z-index: 1;
}

.project-case-study {
  background: #f2f1ed;
}

.project-heading {
  align-items: flex-end;
  margin-bottom: 48px;
}

.project-heading h2 em {
  color: var(--amber);
  font-family: var(--serif);
  font-weight: 400;
}

.project-floor+.project-floor {
  margin-top: 48px;
}

.project-floor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.project-floor-heading span {
  color: var(--amber);
  font: 9px var(--mono);
  letter-spacing: 1px;
}

.project-floor-heading h3 {
  margin: 7px 0 0;
  font: 600 clamp(20px, 2.4vw, 28px)/1.2 var(--head);
}

.project-floor-heading p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
}

.project-gallery-item {
  height: 270px;
}

.gallery-help {
  margin: -11px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.gallery-item.project-gallery-item {
  display: block;
  color: inherit;
}

.gallery-item.project-gallery-item:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  z-index: 1;
}

/* The native dialog provides a full-screen, keyboard-accessible image viewer. */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(14px, 3vw, 34px);
  border: 0;
  background: #101114;
  color: #fff;
  overflow: hidden;
}

.gallery-lightbox::backdrop {
  background: #070809;
}

.gallery-viewer-topbar,
.gallery-viewer-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gallery-viewer-topbar {
  height: 42px;
  color: #d9d8d5;
  font: 9px var(--mono);
  letter-spacing: 1.3px;
}

.gallery-viewer-topbar button,
.gallery-viewer-arrow {
  display: grid;
  place-items: center;
  border: 1px solid #ffffff36;
  background: #ffffff0c;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.gallery-viewer-topbar button:hover,
.gallery-viewer-arrow:hover {
  border-color: var(--amber);
  background: #c25e0033;
}

.gallery-viewer-topbar button {
  width: 40px;
  height: 40px;
  font-size: 25px;
}

.gallery-viewer-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  justify-items: center;
  gap: 14px;
  height: calc(100% - 99px);
  padding: 12px 0;
}

.gallery-viewer-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-viewer-arrow {
  width: 44px;
  height: 54px;
  font-size: 20px;
}

.gallery-viewer-caption {
  min-height: 43px;
  border-top: 1px solid #ffffff26;
  color: #f2f1ed;
}

.gallery-viewer-caption p {
  margin: 0;
  font-size: 11px;
}

.gallery-viewer-caption span {
  color: #c4c1bb;
  font: 9px var(--mono);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .project-floor+.project-floor {
    margin-top: 35px;
  }

  .project-floor-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .project-gallery-item {
    height: 205px;
  }

  .gallery-lightbox {
    padding: 10px 12px;
  }

  .gallery-viewer-stage {
    grid-template-columns: 35px minmax(0, 1fr) 35px;
    gap: 5px;
    height: calc(100% - 86px);
  }

  .gallery-viewer-arrow {
    width: 34px;
    height: 46px;
  }

  .gallery-viewer-caption {
    align-items: flex-start;
    padding-top: 12px;
  }
}

.estimate-reopen {
  position: fixed;
  right: 0;
  left: auto;
  top: 48%;
  z-index: 70;
  border: 1px solid #e4a13b;
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: #17181c;
  color: #fff;
  padding: 19px 11px;
  box-shadow:
    0 8px 28px #0006,
    0 0 18px #e4a13b35;
  display: flex;
  align-items: center;
  gap: 13px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 600 9px var(--mono);
  letter-spacing: 1.3px;
  cursor: pointer;
  transition:
    background 0.2s,
    padding 0.2s,
    box-shadow 0.2s;
}

.estimate-reopen:hover,
.estimate-reopen:focus-visible {
  background: #292a2d;
  padding-top: 23px;
  padding-bottom: 23px;
  box-shadow:
    0 10px 32px #0007,
    0 0 24px #e4a13b55;
}

.estimate-reopen span {
  color: #f0ad43;
  font-size: 15px;
}

.estimate-modal[hidden] {
  display: none;
}

.estimate-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.estimate-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: #111215b8;
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.estimate-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: min(92vh, 740px);
  overflow: auto;
  background: #fbfbf9;
  color: #17181c;
  box-shadow: 0 22px 80px #0005;
  animation: estimate-in 0.25s ease-out;
}

.estimate-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 20px 25px 17px;
  border-bottom: 1px solid rgba(23, 24, 28, 0.12);
  background: #fbfbf9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.estimate-dialog-head small {
  display: block;
  font: 9px var(--mono);
  letter-spacing: 1.3px;
  color: #a4580b;
  margin-bottom: 7px;
}

.estimate-dialog-head h2 {
  font: 700 clamp(16px, 2.7vw, 21px)/1.25 var(--head);
  letter-spacing: -0.04em;
  margin: 0;
}

.estimate-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(23, 24, 28, 0.2);
  background: transparent;
  color: #45464b;
  font-size: 20px;
  cursor: pointer;
}

.estimate-form {
  padding: 22px 25px 25px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.estimate-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.estimate-field.full {
  grid-column: 1/-1;
}

.estimate-field label {
  font: 600 9px var(--mono);
  letter-spacing: 0.9px;
  color: #5f6066;
}

.estimate-field input,
.estimate-field select,
.estimate-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d6d5d2;
  border-radius: 0;
  background: #fff;
  padding: 12px;
  font: 12px var(--sans);
  color: #17181c;
  outline: none;
}

.estimate-field input::placeholder,
.estimate-field textarea::placeholder {
  color: #9b9ba0;
}

.estimate-field input:focus,
.estimate-field select:focus,
.estimate-field textarea:focus {
  border-color: #c25e00;
  box-shadow: 0 0 0 2px #c25e001c;
}

.estimate-field textarea {
  min-height: 74px;
  resize: vertical;
}

.estimate-assurance {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 24, 28, 0.12);
  background: #f6f5f2;
  color: #666871;
  font-size: 9px;
}

.estimate-assurance strong {
  font: 9px var(--mono);
  color: #8b8b8f;
  white-space: nowrap;
}

.estimate-assurance span:first-child {
  color: #b36a11;
  font-size: 15px;
}

.estimate-form .button {
  grid-column: 1/-1;
  width: 100%;
  border: 0;
  background: #111215;
  color: #fff;
  cursor: pointer;
  justify-content: center;
  min-height: 49px;
}

.estimate-form .button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.estimate-form .button span {
  color: #e4a13b;
}

.estimate-status {
  grid-column: 1/-1;
  min-height: 15px;
  margin: 0;
  color: #a4580b;
  font-size: 11px;
}

.estimate-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.estimate-dialog .estimate-field input:user-invalid {
  border-color: #b44833;
}

.estimate-dialog .estimate-field input:valid {
  border-color: #d6d5d2;
}

@keyframes estimate-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .page-hero {
    min-height: 430px;
    padding-top: 58px;
    padding-bottom: 55px;
    background-position: 58% center;
  }

  .page-hero:after {
    right: -23%;
    top: -120px;
    width: 280px;
    height: 280px;
  }

  .estimate-reopen {
    top: auto;
    bottom: 26%;
    padding: 14px 9px;
    font-size: 8px;
  }

  .estimate-modal {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    align-items: stretch;
  }

  .estimate-dialog {
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-height: 100vh;
    box-shadow: none;
  }

  .estimate-dialog-head {
    padding: 15px 17px 13px;
  }

  .estimate-form {
    padding: 16px 17px 24px;
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .estimate-field.full,
  .estimate-assurance,
  .estimate-form .button,
  .estimate-status {
    grid-column: auto;
  }

  .estimate-field input,
  .estimate-field select,
  .estimate-field textarea {
    padding: 11px;
  }

  .estimate-field textarea {
    min-height: 66px;
  }

  .estimate-assurance {
    font-size: 8px;
    align-items: flex-start;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 7px 10px;
  }

  .estimate-assurance strong {
    font-size: 8px;
    grid-column: 2;
    white-space: normal;
  }

  .estimate-form .button {
    margin-top: 2px;
  }

  .estimate-field label {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .estimate-dialog {
    animation: none;
  }

  .estimate-reopen {
    transition: none;
  }
}

.brand-image {
  display: block;
  width: clamp(132px, 12vw, 164px);
  height: auto;
  object-fit: contain;
}

.brand-footer .brand-image {
  width: 150px;
}

.preloader-logo .brand-image {
  width: min(230px, 68vw);
  height: auto;
}

.residential-services .service-card {
  padding: 0;
  min-height: 300px;
  overflow: hidden;
}

.residential-services .service-card>img {
  width: 100%;
  height: 154px;
  flex: 0 0 154px;
  object-fit: cover;
  transition: transform 0.5s;
}

.residential-services .service-card:hover>img {
  transform: scale(1.035);
}

.residential-services .service-card-copy {
  padding: 18px 26px 24px;
}

.residential-services .service-card h3 {
  margin: 15px 0 8px;
}

.residential-services .service-card p {
  font-size: 11px;
}

@media (max-width: 600px) {
  .residential-services .service-card {
    min-height: 0;
  }

  .residential-services .service-card>img {
    height: 185px;
    flex-basis: 185px;
  }

  .residential-services .service-card-copy {
    padding: 17px 20px 22px;
  }
}

.cards-grid .service-card {
  padding: 0;
  min-height: 300px;
  overflow: hidden;
}

.cards-grid .service-card>img {
  width: 100%;
  height: 154px;
  flex: 0 0 154px;
  object-fit: cover;
  transition: transform 0.5s;
}

.cards-grid .service-card:hover>img {
  transform: scale(1.035);
}

.cards-grid .service-card-copy {
  padding: 18px 26px 24px;
}

.cards-grid .service-card h3 {
  margin: 15px 0 8px;
}

.cards-grid .service-card p {
  font-size: 11px;
}

@media (max-width: 600px) {
  .cards-grid .service-card {
    min-height: 0;
  }

  .cards-grid .service-card>img {
    height: 185px;
    flex-basis: 185px;
  }

  .cards-grid .service-card-copy {
    padding: 17px 20px 22px;
  }
}

.site-header {
  border-bottom: 1px solid rgba(23, 24, 28, 0.16);
  box-shadow:
    0 5px 18px rgba(17, 18, 21, 0.09),
    0 1px 0 rgba(194, 94, 0, 0.14);
  transition: box-shadow 0.25s ease;
}

.site-header:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(194, 94, 0, 0.3) 18%,
      rgba(194, 94, 0, 0.3) 82%,
      transparent);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.main-nav>a:not(.nav-contact) {
  position: relative;
}

.main-nav>a:not(.nav-contact):after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 1px;
  background: var(--amber);
  transition: right 0.22s ease;
}

.main-nav>a:not(.nav-contact):hover:after,
.main-nav>a:not(.nav-contact).active:after {
  right: 0;
}

.main-nav>a.active:not(.nav-contact) {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .main-nav>a:after {
    transition: none;
  }
}

.estimate-result strong {
  font-size: clamp(18px, 1.8vw, 25px);
  line-height: 1.3;
  letter-spacing: -0.8px;
  overflow-wrap: anywhere;
}
