
/* --------------------------------------------------------------------------
   Large desktop — reference size
   -------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  html { font-size: 100%; }            /* 16px */
}

/* --------------------------------------------------------------------------
   Nav fit guard
   -------------------------------------------------------------------------- */
/* The nav is set at the comp's own metrics, which need the comp's own width.
   Below that it tightens up rather than wrapping or forcing a scrollbar; the
   rest of the page is untouched, so the layout still reads as the design. */
@media (max-width: 1879.98px) {
  .site-header__inner{
    min-height: auto;
  }
  .primary-nav { padding-inline: 0.75rem 2rem; }
  .primary-nav__list { gap: 1.125rem; }
  .primary-nav__list > li > a:not(.btn) { font-size: 1rem; }
  .btn--phone { font-size: 1.0625rem; padding-inline: 1rem; }
  .primary-nav__list > li.has-submenu > a:not(.btn)::after {
    top: 1.05rem;
  }
  .primary-nav__list > li.has-submenu:hover > a:not(.btn)::after,
  .primary-nav__list > li.has-submenu:focus-within > a:not(.btn)::after {
    top: 1rem;
  }

  .financing__grid {
    padding: 0 4%;
  }
  .financing__body {
    padding: 1.7rem 0;
  }

}

/* --------------------------------------------------------------------------
   Desktop
   -------------------------------------------------------------------------- */
@media (max-width: 1599.98px) {
  html { font-size: 90.625%; }         /* 14.5px */
}

/* --------------------------------------------------------------------------
   Small desktop / large laptop
   -------------------------------------------------------------------------- */
@media (max-width: 1399.98px) {
  html { font-size: 81.25%; }          /* 13px */

  :root { --gutter: 2rem; }

  .primary-nav { padding-inline: 0.5rem 1.5rem; }
  .primary-nav__list { gap: 0.875rem; }
  .primary-nav__list > li > a:not(.btn) { font-size: 1rem; }
  .btn--phone { font-size: 1rem; padding-inline: 0.875rem; }

  .primary-nav__list > li.has-submenu > a:not(.btn)::after {
    top: 1rem;
  }
  .primary-nav__list > li.has-submenu:hover > a:not(.btn)::after,
  .primary-nav__list > li.has-submenu:focus-within > a:not(.btn)::after {
    transform: rotate(225deg);
    top: 1.19rem;
  }

  .hero {
    min-height: calc(100vh - 6.125rem);
  }
  .hero__content {
    padding: 0 var(--gutter) 3rem;
  }
  .financing__body > p{
    font-size: 1.25rem;
  }
  .financing__title {
    font-size: 2rem;
    margin-bottom: 1.25rem;
  }
  .feed-card__text{
    font-size: 1.25rem;
  }

}

/* --------------------------------------------------------------------------
   Laptop
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  html { font-size: 75%; }             /* 12px */

  :root { 
    --header-h: 7rem; 
    --fs-h1: 3.5rem;
    --fs-h2: 2.5rem;
    --fs-h3: 1.75rem;
    --fs-h4: 1.875rem;
    --fs-body: 1.25rem;
    --fs-sm: 1.125rem;
    --fs-xs: 1rem;
  }

  /* ---- Header switches to the hamburger drawer ---- */
  .site-header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
  }
  .site-header__inner { align-items: center; padding-right: var(--gutter); }

  .logo-plate {
    width: auto;
    max-width: 20rem;
    align-self: stretch;
    border-bottom-right-radius: 2.75rem;
    border-right-width: 0.25rem;
  }

  .nav-toggle { display: flex; }

  .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 110;
    width: min(24rem, 82vw);
    padding: 6rem 2rem 2rem;
    background: var(--navy);
    transform: translateX(100%);
    /* visibility keeps the closed drawer out of the tab order, and stops its
       shadow painting over the page edge while it sits off-canvas */
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    overflow-y: auto;
    justify-content: flex-start;
    align-items: stretch;
  }
  .primary-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, visibility 0s;
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .primary-nav__list > li { border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
  .primary-nav__list > li > a:not(.btn) {
    display: block;
    padding: 1rem 0.25rem;
    font-size: 1.25rem;
    border-bottom: 0;
  }
  .primary-nav__list > li:last-of-type{
    border-bottom: none;
  }
  .primary-nav__phone { margin: 1.5rem 0 0; border-bottom: 0; }
  .primary-nav__phone .btn { width: 100%; font-size: 1.25rem; padding-block: 0.75rem; }

  /* ---- Submenu: the drawer has no hover, so the desktop dropdown is
     replaced with a tap-to-expand accordion (button toggles .is-open,
     see script.js) shown as an indented list under its parent link ---- */
  .primary-nav__list > li.has-submenu > a:not(.btn) {
    padding-right: 3rem;      /* keep the label clear of the toggle button */
  }
  .primary-nav__list > li.has-submenu > a:not(.btn)::after {
    display: none;            /* caret is desktop-only; button has its own arrow */
  }
  .submenu-toggle {
    display: flex;
    width: 2rem;
    top: 1rem;
    height: 1.5rem;
  }
  .submenu-toggle.is-open{
    top: 1.5rem;
  }

  .submenu {
    position: static;
    z-index: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border-left: none;
    box-shadow: none;
    opacity: 0;
    visibility: visible;
    transform: none;
    max-height: 0;             /* overridden inline by script.js to match real content height */
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
  }
  .submenu.is-open {
    opacity: 1;
    padding: 0 0 1.25rem 1.25rem;
  }
  .submenu li a {
    padding: 0.625rem 0;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
  }
  .submenu li a:hover,
  .submenu li a:focus-visible {
    background: transparent;
    color: var(--cyan);
  }

  /* Stop the page scrolling behind the open drawer */
  body.nav-open { overflow: hidden; }

  .about__grid { grid-template-columns: 18rem 1fr; gap: 4.5rem; }

  .service-panel--cyan .service-panel__inner { padding-left: 4rem; padding-right: 4rem; }
  .service-panel--navy .service-panel__inner { padding-left: 4rem; padding-right: 4rem; }

  .feed-grid { gap: 1.75rem; }

  .financing__disc { width: 30rem; height: 30rem; }
  .btn--hero-commercial, .btn--hero-residential{
    font-size: 1.25rem;
  }
  .seal-grid__item img {
    max-width: 13.75rem;
  }
  .beat-heat__actions .btn img {
    width: 1.75rem;
  }
  .benefit-grid__item:first-of-type img {
    width: 10.625rem;
  }
  .benefit-grid__item:nth-of-type(2) img {
    width: 8.313rem;
  }
  .benefit-grid__item:nth-of-type(3) img {
    width: 7.875rem;
  }
  .benefit-grid__item:nth-of-type(4) img {
    width: 8.688rem;
  }
  .benefit-grid__item:nth-of-type(5) img {
    width: 7.813rem;
  }
  .financing__body {
    max-width: 33.438rem;
  }
  .maintenance.second .benefit-grid__item:first-of-type img,
  .maintenance.second .benefit-grid__item:nth-of-type(2) img,
  .maintenance.second .benefit-grid__item:nth-of-type(3) img,
  .maintenance.second .benefit-grid__item:nth-of-type(4) img,
  .maintenance.second .benefit-grid__item:nth-of-type(5) img,
  .maintenance.second .benefit-grid__item:nth-of-type(6) img{
    width: 7.875rem;
  }
  
}

/* --------------------------------------------------------------------------
   Tablet — layout starts to stack, hamburger takes over
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  html { font-size: 87.5%; }           /* 14px — back up for readability */

  :root {
    --gutter: 1.5rem;
    --header-h: 5.75rem;
    --fs-h1: 2.75rem;
    --fs-h2: 2rem;
    --fs-h3: 1.5rem;
    --fs-h4: 1.3125rem;
    --fs-body: 1.0625rem;
    --fs-sm: 1rem;
    --fs-xs: 0.9375rem;
  }

  /* ---- Header ---- */
  .logo-plate {
    max-width: 15rem;
  }
  .primary-nav { width: min(22rem, 82vw); }
  .primary-nav__list > li > a:not(.btn) { font-size: 1.125rem; }
  .primary-nav__phone .btn { font-size: 1.125rem; }

  /* ---- Hero ---- */
  .hero { min-height: 30rem; }
  .hero__content { padding-bottom: 3rem; }
  .hero__title { margin-bottom: 2rem; }
  .hero__actions { gap: 1rem; }
  .btn--hero-commercial,
  .btn--hero-residential { min-width: 20rem; font-size: 1.125rem; }

  /* ---- About ---- */
  .about { padding: 3rem 0; }
  .about__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    justify-items: center;
  }
  .about__media img { max-width: 16rem; }
  .about__body p { max-width: 42rem; margin-inline: auto; }

  /* ---- Services: photo above, copy below ---- */
  .service-row,
  .service-row--reverse { grid-template-columns: 1fr; min-height: 0; }
  /* Keep the image first on every stacked row so the rhythm stays consistent */
  .service-row .service-media  { order: 1; }
  .service-row .service-panel  { order: 2; }

  .service-media img { min-height: 0; height: 16rem; }

  .service-panel--cyan .service-panel__inner,
  .service-panel--navy .service-panel__inner {
    padding: 2.5rem var(--gutter);
    max-width: none;
  }
  .service-panel__inner { width: 100%; }
  .service-panel p { max-width: none; }

  /* ---- Award seals ---- */
  .experience { padding: 3.5rem 0; }
  .seal-grid { grid-template-columns: repeat(3, 1fr); }
  .seal-grid__item { padding: 1.25rem 0.5rem; }

  .section-heading { gap: 1rem; }
  .section-heading__rule { flex-basis: 6rem; }

  /* ---- Beat the heat ---- */
  .beat-heat { padding: 0; }
  .beat-heat__photo {
    position: relative;
    width: 100%;
    height: 15rem;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .beat-heat__container { padding-block: 2.5rem; }
  .beat-heat__card { max-width: none; padding: 2rem 1.75rem 2.25rem; }

  /* ---- Maintenance ---- */
  .maintenance { padding: 3rem 0; }
  .ribbon { padding: 0.875rem 2.5rem; font-size: 1.75rem; }
  .ribbon--sm { font-size: 1.375rem; padding: 0.75rem 2.25rem; }

  .benefit-grid, .maintenance.second .benefit-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem 0; }
  .benefit-grid__item { padding-inline: 0.75rem; }
  .benefit-grid__item:first-child { border-left: 0; }
  .benefit-grid__item:nth-child(3n + 1) { border-left: 0; }
  .benefit-grid__item img { width: 6.5rem; }

  /* ---- Financing ---- */
  .financing__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: 0;
    text-align: center;
    justify-items: center;
  }
  .financing__body { max-width: 100%; }
  .financing__list li { justify-content: center; }
  .financing__disc { width: 20rem; height: 20rem; }
  .financing__logo { width: 12rem; }
  .financing__art { max-width: 16rem; }

  /* ---- Social feed ---- */
  .feed-grid { grid-template-columns: repeat(2, 1fr); }
  .social__title { font-size: 1.25rem; }

  /* ---- Testimonials ---- */
  .testimonials__stage { gap: 0.5rem; }
  .slider-arrow { width: 2.25rem; height: 2.25rem; }
  .slider-arrow img{ width: 100%; height: 100%; object-fit: contain;}
  .testimonials__stars svg { width: 2rem; height: 2rem; }
  .testimonials__stars svg:nth-child(3) { width: 2.5rem; height: 2.5rem; }

  /* ---- Education ---- */
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .article-card { min-height: 0; padding: 1.5rem 1.375rem; }

  /* ---- Areas / footer ---- */
  .areas__list { font-size: 1.125rem; line-height: 1.8; }

  .site-footer { margin-top: 4rem; padding-top: 5rem; }
  .site-footer__badge {
    top: -2rem;
  }
  .site-footer__badges { gap: 2.5rem; }
  .seal-grid__item img {
    max-width: 9.75rem;
  }
  .financing__media{
    display: none;
  }
  .education {
    padding: 2rem 0 1rem;
  }
  .maintenance.second .benefit-grid__item:first-of-type img,
  .maintenance.second .benefit-grid__item:nth-of-type(2) img,
  .maintenance.second .benefit-grid__item:nth-of-type(3) img,
  .maintenance.second .benefit-grid__item:nth-of-type(4) img,
  .maintenance.second .benefit-grid__item:nth-of-type(5) img,
  .maintenance.second .benefit-grid__item:nth-of-type(6) img{
    width: 6.5rem;
  }
}

/* --------------------------------------------------------------------------
   Large mobile
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  :root {
    --fs-h1: 2.75rem;
    --fs-h2: 2rem;
    --fs-h3: 30px;
    --fs-h4: 24px;
    --fs-body: 24px;
    --fs-sm: 20px;
    --fs-xs: 18px;
  }

  .site-header__inner {
    padding-right: 25px;
  }
  .logo-plate {
    max-width: 235px;
  }
  .nav-toggle{
    width: 35px;
  }
  .nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(16px) rotate(45deg);
  }

  .hero {
    min-height: 300px;
  }
  .hero__content{
    padding: 20px;
  }
  .hero__title{
    margin-bottom: 18px;
    font-size: 30px;
  }
  .hero__actions {
    display: none;
  }
  .hero__actions.mob {
    display: flex;
  }
  .btn--hero-commercial,
  .btn--hero-residential { 
    width: 100%; 
    max-width: fit-content; 
    min-width: 0; 
    font-size: 16px;
  }
  .hero__scrim {
    height: 200px;
  }
  .hero__bg{
    object-position: center;
  }
  .about {
    padding: 20px 0 50px;
  }
  .about__grid{
    gap: 10px;
  }
  .about__media img {
    max-width: 100%;
    width: 100%;
    height: 100%;
  }
  .about__body{
    text-align: left;
  }
  .about__title{
    font-size: 36px;
  }
  .about__body p{
    font-size: 24px;
  }
  .about__body .btn-primary{
    font-size: 24px;
  }
  .service-media img {
    height: 355px;
  }
  .service-panel--cyan .service-panel__inner, .service-panel--navy .service-panel__inner {
    padding: 40px 55px;
    max-width: none;
  }
  .experience {
    padding: 42px 0 50px;
  }
  .section-heading__rule{
    display: none;
  }

  .seal-grid {
      display: flex;
      gap: 0;
  }

  .seal-grid__item {
      width: 100%;
      flex-shrink: 0;
      border: none;
      padding: 0;
      margin: 0;
  }

  .seal-grid__item img {
    max-width: 75%;
  }

  .swiper-pagination {
      position: static;
      margin-top: 20px;
      text-align: center;
  }

  .swiper-pagination-bullet {
      width: 9px;
      height: 9px;
      opacity: 1;
      background: #1b3f98;
  }

  .swiper-pagination-bullet-active {
    background: #009df1;
  }

  .beat-heat{
    padding: 345px 40px 40px;
  }
  .beat-heat__container{
    padding: 0;
  }
  .beat-heat__photo.desk{
    display: none;
  }
  .beat-heat__photo.mob{
    display: block;
    position: absolute;
    left: 0; 
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .beat-heat__card{
    padding: 40px 15px;
  }
  .beat-heat__title{
    font-size: 36px;
    padding: 0 25px;
  }
  .beat-heat__card p{
    font-size: 24px;
    padding: 0 25px;
  }
  .beat-heat__actions .btn img {
    width: 34px;
  }
  .beat-heat__actions .btn {
    width: 100%;
    max-width: 100%;
    font-size: 20px;
    padding: 8px 20px !important;
  }
  .beat-heat__actions .btn.btn--cyan {
    padding: 13px 5px !important;
  }
  .beat-heat__actions { grid-template-columns: 1fr; }
  .maintenance {
    padding: 40px 10px;
  }
  .ribbon {
    padding: 0.875rem 2.5rem;
    font-size: 36px;
  }
  .maintenance__lead {
    font-size: 24px;
  }

  .benefit-grid, .maintenance.second .benefit-grid {
      display: flex;
      gap: 0;
      margin-bottom: 0;
  }

  .benefit-grid__item {
      width: 100%;
      flex-shrink: 0;
      border: none;
      padding: 0;
      margin: 0;
  }

  .benefit-slider .swiper-pagination {
      position: static;
      margin-top: 20px;
      text-align: center;
  }
  .maintenance__cta{
    margin-top: 40px;
  }
  .benefit-grid__item:nth-of-type(1) img,
  .benefit-grid__item:nth-of-type(2) img,
  .benefit-grid__item:nth-of-type(3) img,
  .benefit-grid__item:nth-of-type(4) img,
  .benefit-grid__item:nth-of-type(5) img{
    width: auto;
  }
  .financing__grid{
    padding: 0;
    flex-wrap: wrap;
  }
  .financing__body{
    padding: 55px 50px 0;
    text-align: left;
    position: relative;
    z-index: 2;
  }
  .financing__title{
    font-size: 36px;
  }
  .financing__body > p{
    font-size: var(--fs-body);
  }
  .financing__list{
    margin-bottom: 35px;
  }
  .financing__list li {
    justify-content: flex-start;
  }
  .financing .btn--dark-pale{
    color: #1b3f98;
  }
  .financing__media.mob{
    display: block;
    width: 100%;
    margin-top: -110px;
    z-index: 1;
  }
  .financing__media.mob img{
    width: 100%;
    max-width: 100%;
  }
  .social{
    padding: 30px 0;
  }
  .social__title {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 30px;
  }

  .feed-slider{
    width: 70%;
  }
  .feed-grid {
      display: flex;
      gap: 0;
  }

  .feed-card {
      width: 100%;
      flex-shrink: 0;
  }

  .feed-slider .swiper-pagination {
      position: static;
      margin-top: 30px;
      text-align: center;
  }
  .social__cta{
    margin-top: 30px;
  }
  .social__icons .icon {
    width: 3.125rem;
    height: 3.125rem;
  }
  .social__icons{
    margin-bottom: 10px;
  }
  .testimonial p {
    line-height: 1.15;
    font-size: var(--fs-body);
  }
  .testimonial cite{
    font-size: var(--fs-body);
  }
  .slider-arrow{
    margin-top: 75px;
  }

  .education {
    padding: 10px 0 0;
  }
  .education::before{
    display: none;
  }
  .education .section-heading{
    font-size: 44px;
  }

  .article-grid {
      display: flex;
      gap: 0;
  }

  .article-card {
      width: 100%;
      flex-shrink: 0;
      padding: 35px 50px 35px 33px;
  }

  .article-slider .swiper-pagination {
      position: static;
      margin-top: 20px;
      text-align: center;
  }
  .education__cta{
    margin-top: 30px;
  }
  .article-card__title{
    font-size: 30px;
  }
  .areas .ribbon{
    font-size: 22px;
  }
  .areas__list{
    font-size: 20px;
    line-height: 1.2;
  }
  .areas__list br{
    display: none;
  }

  .site-footer__badge {
    top: -1rem;
  }
  .site-footer__social {
    margin: 20px 0 30px;
  }
  .site-footer__social .icon {
    width: 3.5rem;
    height: 3.5rem;
  }
  .site-footer__badges{
    flex-direction: column;
    gap: 45px;
    margin-bottom: 40px;
  }
  .site-footer__legal{
    font-size: 17px;
    max-width: 385px;
    margin: 0 auto;
  }
  .maintenance.second .benefit-grid__item:first-of-type img,
  .maintenance.second .benefit-grid__item:nth-of-type(2) img,
  .maintenance.second .benefit-grid__item:nth-of-type(3) img,
  .maintenance.second .benefit-grid__item:nth-of-type(4) img,
  .maintenance.second .benefit-grid__item:nth-of-type(5) img,
  .maintenance.second .benefit-grid__item:nth-of-type(6) img{
    width: auto;
  }
  .mobile-sticky-btn{
    display: flex;
  }

}

/* --------------------------------------------------------------------------
   Very small handsets — final safety net against overflow
   -------------------------------------------------------------------------- */
@media (max-width: 495px) {
  html { font-size: 75%; }
  :root {
    --fs-h1: 2.75rem;
    --fs-h2: 2rem;
    --fs-h3: 26px;
    --fs-h4: 22px;
    --fs-body: 18px;
    --fs-sm: 18px;
    --fs-xs: 16px;
  }
  
  .btn--hero-commercial, .btn--hero-residential {
    font-size: 14px;
  }
  .about__title {
    font-size: 30px;
  }
  .about__body p {
    font-size: 18px;
  }
  .about__body .btn-primary {
    font-size: 20px;
  }
  .service-panel--cyan .service-panel__inner, .service-panel--navy .service-panel__inner {
    padding: 30px 30px 35px;
  }
  .experience .section-heading {
    margin-bottom: 2.5rem;
    line-height: 1.2;
  }
  .beat-heat {
    padding: 340px 20px 30px;
  }
  .beat-heat__card {
    padding: 30px 10px;
  }
  .beat-heat__title {
    font-size: 28px;
    padding: 0 10px;
  }
  .beat-heat__card p {
    font-size: 18px;
    padding: 0 10px;
  }
  .beat-heat__actions .btn {
    font-size: 16px;
    padding: 8px 18px !important;
  }
  .ribbon {
    padding: 0.875rem 2rem;
    font-size: 26px;
  }
  .maintenance__lead {
    font-size: 20px;
    line-height: 1.2;
  }
  .maintenance__copy{
    font-size: 18px;
  }
  .maintenance__subhead{
    line-height: 1.2;
  }
  .financing__body {
    padding: 35px 30px 0;
  }
  .financing__title {
    font-size: 30px;
  }
  .financing__body > p{
    font-size: 18px;
  }
  .financing__list li{
    font-size: 18px;
  }
  .financing__media.mob{
    margin-top: -75px;
  }
  .social__title {
    font-size: 26px;
  }
  .feed-slider {
    width: 80%;
  }
  .education .section-heading {
    font-size: 36px;
    line-height: 1.2;
  }
  .article-card {
    padding: 30px;
  }
  .article-card__title {
    font-size: 26px;
  }
  .article-card__excerpt{
    font-size: 18px;
  }
  .site-footer__legal{
    font-size: 16px;
  }
  
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .nav-toggle, .slider-arrow,
  .testimonials__dots, .social__cta { display: none !important; }
  body { color: #000; }
}
