/* Compact shared header: 55% of the previous height at each breakpoint. */
:root {
  --header-original-height: 114px;
  --header-call-width: 236px;
  --header-call-height: 29px;
  --site-header-height: calc(var(--header-original-height) * .55);
  --header-logo-width: 154px;
}

html { scroll-padding-top: calc(var(--site-header-height) + 20px); }

.home-page { --home-header-height: var(--site-header-height); }

.site-header {
  height: var(--site-header-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  --header-column-gap: clamp(18px, 2.2vw, 36px);
  column-gap: var(--header-column-gap);
  padding-inline: clamp(28px, 3.3vw, 70px);
  border-bottom: 0;
}

.site-header,
.home-page .site-header.is-scrolled,
.home-page.menu-open .site-header {
  background: linear-gradient(180deg, rgb(255 255 255 / 7%), transparent 34%, transparent 64%, rgb(3 12 85 / 18%)), var(--blue);
  box-shadow: 0 -2px 8px rgb(4 16 52 / 8%), 0 8px 22px rgb(3 14 40 / 25%), inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -1px 0 rgb(0 12 82 / 14%);
}

.home-page:not(.menu-open) .site-header:not(.is-scrolled) {
  background: transparent;
  box-shadow: none;
}

/* Keep the homepage header fully branded on tablets and phones. */
@media (max-width: 1279px) {
  .home-page:not(.menu-open) .site-header:not(.is-scrolled) {
    background: linear-gradient(180deg, rgb(255 255 255 / 7%), transparent 34%, transparent 64%, rgb(3 12 85 / 18%)), var(--blue);
    box-shadow: 0 -2px 8px rgb(4 16 52 / 8%), 0 8px 22px rgb(3 14 40 / 25%), inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -1px 0 rgb(0 12 82 / 14%);
  }
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: var(--header-logo-width);
  min-width: 0;
}

.site-header .logo {
  width: 100%;
  height: 31.9px;
}

.site-header .logo img {
  width: calc(100% + 16.5px);
  left: -8.25px;
}

.site-header .header-credentials {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1px;
  padding: 0;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.site-header .credential-badge {
  width: 11px;
  height: 11px;
  transform: none;
}

.site-header .credential-license {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.site-header .credential-status {
  text-transform: uppercase;
  letter-spacing: .025em;
}

.site-header .header-credentials strong {
  padding: 0;
  border: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .045em;
}

.site-header .desktop-nav {
  justify-content: center;
  justify-self: center;
  gap: clamp(14px, 1.65vw, 30px);
}

.site-header .desktop-nav a {
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 600;
  line-height: 1.3;
  min-height: 48px;
}

.site-header .header-actions {
  justify-self: end;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 16px;
}

.site-header .header-call {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  flex-direction: row;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: var(--header-call-width);
  min-height: var(--header-call-height);
  padding: 2px 16px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  text-shadow: none;
  box-shadow: 0 4px 12px rgb(6 24 61 / 18%);
  touch-action: manipulation;
  transition: background-color 180ms ease;
}

/* A simple orange button with a quick, repeating light pulse.
   The light stays beneath the lettering so the text never flashes or fades. */
.site-header .header-call::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.site-header .header-call > span {
  position: relative;
  z-index: 1;
  color: #fff;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 1px rgb(85 27 0 / 45%);
}
.header-call-label { font-size: 12px; font-weight: 700; letter-spacing: .11em; }
.header-call-number { font-size: 18px; font-weight: 700; letter-spacing: .015em; }

@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  .site-header .header-call {
    animation: header-call-light-pulse 1s ease-in-out infinite;
  }
  .site-header .header-call::before {
    animation: header-call-light-flash 1s ease-in-out infinite;
  }
}

@keyframes header-call-light-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgb(6 24 61 / 18%),
      0 0 0 0 rgb(255 255 255 / 0%),
      0 0 5px 0 rgb(255 101 13 / 20%);
  }
  45% {
    box-shadow: 0 4px 12px rgb(6 24 61 / 18%),
      0 0 7px 1px rgb(255 255 255 / 70%),
      0 0 20px 4px rgb(255 101 13 / 65%);
  }
}

@keyframes header-call-light-flash {
  0%, 100% { opacity: 0; }
  45% { opacity: .12; }
}

.site-header .header-call:is(:hover, :focus-visible) {
  background-color: #ff8035;
  color: #fff;
}

.site-header .header-call:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

@media (forced-colors: active) {
  .site-header .header-call::before { display: none; }
  .site-header .header-call { border-color: ButtonText; }
  .site-header .header-call > span { color: LinkText; text-shadow: none; }
}

.header-estimate-iggy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46.2px;
  height: 46.2px;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  touch-action: manipulation;
}

.header-estimate-iggy img {
  width: 46.2px;
  height: 46.2px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 3px rgb(0 0 0 / 12%));
  pointer-events: none;
  transition: transform 180ms ease, filter 180ms ease;
}

.header-estimate-iggy:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.header-estimate-iggy:active img { transform: scale(.96); }

@media (hover: hover) and (pointer: fine) {
  .header-estimate-iggy:hover img {
    transform: translateY(-2px) scale(1.04);
    filter: brightness(0) invert(1) drop-shadow(0 3px 8px rgb(255 255 255 / 24%));
  }
}

@media (min-width: 1600px) {
  :root { --header-original-height: 121px; --header-logo-width: 166px; }
  .site-header .logo { height: 34.1px; }
  .site-header .header-credentials,
  .site-header .header-credentials strong { font-size: 9.5px; }
  .site-header .desktop-nav a { font-size: 20px; }
}

@media (max-width: 1279px) and (min-width: 1191px) {
  .site-header { column-gap: 22px; padding-inline: 28px; }
}

@media (max-width: 1190px) and (min-width: 1001px) {
  :root { --header-logo-width: 216px; --header-call-width: 196px; }
  .site-header { column-gap: 16px; padding-inline: 20px; }
  .site-header .logo { height: 56px; }
  .site-header .header-credentials,
  .site-header .header-credentials strong { font-size: 9px; }
  .site-header .desktop-nav { gap: 12px; }
  .site-header .desktop-nav a { font-size: 15px; }
  .header-estimate-iggy,
  .header-estimate-iggy img { width: 76px; height: 76px; }
  .site-header .header-actions { gap: 12px; }
  .site-header .header-call { padding-inline: 12px; gap: 10px; }
  .header-call-label { font-size: 10.5px; letter-spacing: .075em; }
  .header-call-number { font-size: 16px; }
}

@media (max-width: 1000px) {
  :root { --header-original-height: 95px; --header-logo-width: 144px; --header-call-height: 44px; }
  .site-header { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .site-header .desktop-nav,
  .header-estimate-iggy { display: none; }
  .site-header .logo { height: 29.7px; }
  .site-header .header-credentials,
  .site-header .header-credentials strong { font-size: 8px; }
  .site-header .credential-badge { width: 10px; height: 10px; }
  .header-brand { width: min(var(--header-logo-width), 100%); }
  .site-header .menu-toggle { min-width: 52px; height: 44px; }
  .site-header .menu-toggle img { width: 36px; height: 36px; }
  .site-header .header-actions { gap: 14px; }
  .mobile-nav:not([hidden]) { top: var(--site-header-height); }
}

@media (max-width: 680px) {
  :root { --header-original-height: 98px; --header-logo-width: 132px; --header-call-width: 124px; }
  .site-header { padding-inline: 12px; column-gap: 12px; }
  .header-brand { gap: 1px; }
  .site-header .logo { height: 26.4px; }
  .site-header .header-credentials { gap: 1px; font-size: 8.5px; }
  .site-header .credential-status { text-transform: none; letter-spacing: 0; }
  .site-header .header-credentials strong { font-size: 8.5px; padding-left: 0; border-left: 0; letter-spacing: .04em; }
  .site-header .menu-toggle { min-width: 44px; height: 44px; }
  .site-header .menu-toggle img { width: 30px; height: 30px; }
  .site-header .menu-toggle > span { font-size: 9px; line-height: 1.2; }
  .site-header .header-actions { gap: 10px; }
  .site-header .header-call { flex-direction: column; padding: 4px 10px; gap: 3px; }
  .header-call-label { font-size: 10.5px; letter-spacing: .075em; }
  .header-call-number { font-size: 14px; letter-spacing: 0; }
}

@media (max-width: 370px) {
  :root { --header-original-height: 140px; --header-logo-width: 126px; --header-call-width: 116px; }
  .site-header { padding: 0 10px; column-gap: 6px; }
  .site-header .header-actions { gap: 6px; }
  .site-header .header-call { padding-inline: 6px; }
  .site-header .logo { height: 25.3px; }
  .site-header .header-credentials { font-size: 8px; }
  .site-header .header-credentials strong { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .header-estimate-iggy img,
  .site-header .header-call { transition: none; }
  .header-estimate-iggy:hover img,
  .header-estimate-iggy:active img { transform: none; }
}

/* Equal side columns keep the navigation on the page center. */
@media (min-width: 1280px) and (max-width: 1599px) {
  .site-header { --header-column-gap: 18px; column-gap: var(--header-column-gap); padding-inline: 28px; }
  .site-header .desktop-nav { gap: clamp(12px, 1.1vw, 18px); }
  .site-header .desktop-nav a { font-size: 16px; }
}
@media (min-width: 1001px) and (max-width: 1279px) {
  :root { --header-original-height: 95px; --header-logo-width: 144px; --header-call-height: 44px; }
  .site-header { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .site-header .desktop-nav, .header-estimate-iggy { display: none; }
  .site-header .logo { height: 29.7px; }
  .site-header .header-credentials,
  .site-header .header-credentials strong { font-size: 8px; }
  .site-header .credential-badge { width: 10px; height: 10px; }
  .header-brand { width: min(var(--header-logo-width), 100%); }
  .site-header .header-actions { gap: 14px; }
  .site-header .menu-toggle { display: flex; align-items: center; gap: 8px; padding: 0; min-width: 80px; height: 44px; }
  .site-header .menu-toggle img { width: 36px; height: 36px; object-fit: contain; }
  .site-header .menu-toggle > span { font-size: 10px; letter-spacing: .6px; }
  .mobile-nav:not([hidden]) { display: flex; flex-direction: column; position: fixed; inset: var(--site-header-height) 0 0; z-index: 49; overflow: auto; background: var(--blue); color: white; padding: 20px var(--pad) 95px; }
  .mobile-nav > a { padding: 17px 0; font-size: 25px; font-weight: 500; border-bottom: 1px solid #ffffff40; }
  .mobile-nav > a[aria-current] { color: #ffbb95; }
  .mobile-nav > a.mobile-phone { font-size: 21px; display: flex; align-items: center; gap: 15px; border-bottom: 0; margin-top: 18px; }
}

/* Center Call Now in the space between Contact and Iggy. */
@media (min-width: 1280px) {
  .site-header .header-actions {
    justify-self: stretch;
    gap: 0;
    margin-inline-start: calc(-1 * var(--header-column-gap));
  }
  .site-header .header-call { margin-inline: auto; }
  .site-header .header-estimate-iggy { flex: 0 0 46.2px; }
}

/* A small credential badge beside the wordmark, centered before Home. */
@media (min-width: 1280px) {
  .header-brand {
    display: grid;
    grid-template-columns: var(--header-logo-width) minmax(0, 1fr);
    column-gap: 12px;
    width: 100%;
  }

  .site-header .logo { width: var(--header-logo-width); }

  .site-header .header-credentials {
    justify-self: center;
    width: max-content;
    max-width: 100%;
    gap: 3px;
    font-size: 8px;
    line-height: 1.2;
  }

  .site-header .header-credentials strong {
    font-size: 8px;
    line-height: 1.2;
  }

  .site-header .credential-license { gap: 4px; }
  .site-header .credential-badge { width: 10px; height: 10px; }
}
