/* =========================================================
   QUALITY MECHANICAL & FIREPLACES
   COMPLETE RESPONSIVE OVERRIDES
   ========================================================= */

:root {
  --page-max-width: 1250px;
  --page-padding: clamp(16px, 4vw, 40px);

  --color-background: #fff9f1;
  --color-surface: #fcf8ee;
  --color-surface-light: #fff;
  --color-text: #2b140c;
  --color-accent: #d84a0f;
  --color-accent-dark: #a93a0d;

  --header-height: 110px;
  --shadow-menu: 0 18px 45px rgba(31, 18, 10, 0.18);

  --heading-font: "Cinzel", Georgia, serif;
  --body-font: "Lora", Georgia, serif;
}

/* ---------------------------------------------------------
   GLOBAL SAFETY
   --------------------------------------------------------- */

html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

img,
picture,
video,
iframe,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

.container {
  width: min(
    calc(100% - (var(--page-padding) * 2)),
    var(--page-max-width)
  );
  max-width: var(--page-max-width);
  margin-inline: auto;
}

main {
  min-width: 0;
}

section {
  min-width: 0;
}

h1,
h2,
h3,
h4,
p,
li,
a,
button,
label,
summary {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Prevent oversized headings throughout the project. */

h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.7rem, 3.8vw, 3.25rem);
  line-height: 1.15;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  line-height: 1.3;
}

/* ---------------------------------------------------------
   ACCESSIBILITY
   --------------------------------------------------------- */

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;

  padding: 12px 18px;

  color: #fff;
  background: var(--color-text);
  border-radius: 6px;

  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(216, 74, 15, 0.45);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   HEADER AND NAVIGATION
   --------------------------------------------------------- */

.main-header {
  position: relative;
  z-index: 1000;

  width: 100%;
  padding: 16px 0;

  background: var(--color-surface);
}

.header-content {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 30px);

  min-width: 0;
}

.logo {
  flex: 0 1 auto;
  min-width: 0;
}

.logo img {
  width: clamp(150px, 16vw, 210px);
  max-height: 90px;
  object-fit: contain;
}

.main-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;

  min-width: 0;
}

.main-header nav > a,
.main-header .dropdown-btn {
  min-height: 46px;
  padding: 10px 14px;

  font-size: clamp(0.79rem, 1vw, 1rem);
  line-height: 1.2;
  white-space: nowrap;
}

.dropdown {
  position: relative;
}

.dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dropdown-content {
  top: calc(100% + 8px);
  left: 0;

  width: min(270px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);

  visibility: hidden;
  pointer-events: none;

  transform: translateY(-8px);

  transition:
    max-height 250ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.dropdown-content.show {
  visibility: visible;
  pointer-events: auto;

  max-height: min(70vh, 520px);
  overflow-y: auto;

  opacity: 1;
  transform: translateY(0);
}

.dropdown-content a {
  min-height: 48px;

  display: flex;
  align-items: center;

  white-space: normal;
}

.mobile-menu-toggle {
  display: none;

  width: 48px;
  height: 48px;
  padding: 0;

  flex: 0 0 48px;
  align-items: center;
  justify-content: center;

  color: var(--color-text);
  background: #fff;
  border: 2px solid var(--color-accent);
  border-radius: 7px;

  cursor: pointer;
}

.mobile-menu-toggle-lines,
.mobile-menu-toggle-lines::before,
.mobile-menu-toggle-lines::after {
  display: block;

  width: 23px;
  height: 2px;

  background: currentColor;
  border-radius: 999px;

  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.mobile-menu-toggle-lines {
  position: relative;
}

.mobile-menu-toggle-lines::before,
.mobile-menu-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.mobile-menu-toggle-lines::before {
  top: -7px;
}

.mobile-menu-toggle-lines::after {
  top: 7px;
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-lines {
  background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"]
  .mobile-menu-toggle-lines::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"]
  .mobile-menu-toggle-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */

.hero,
.hero-overlay {
  min-height: clamp(500px, 72vh, 720px);
}

.hero-content {
  width: 100%;
  padding-block: clamp(70px, 10vw, 130px);
}

.hero h2 {
  max-width: 1050px;
  margin: 0 auto 24px;

  font-size: clamp(2.15rem, 5.5vw, 4rem);
  line-height: 1.13;

  white-space: normal;
}

.hero p {
  width: min(100%, 760px);
  margin-inline: auto;

  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.hero-buttons,
.catalog-intro-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;

  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 48px;
  max-width: 100%;
  padding: 14px 24px;

  text-align: center;
  white-space: normal;
}

/* ---------------------------------------------------------
   SHARED SECTION SPACING
   --------------------------------------------------------- */

.features,
.projects,
.services-section,
.portfolio-section,
.faq-page-section,
.gas-services-section {
  padding-block: clamp(45px, 7vw, 85px);
}

.about-intro,
.faq-intro,
.portfolio-intro,
.catalog-intro,
.gas-page-intro,
.coming-soon-page {
  padding-block: clamp(60px, 9vw, 120px);
}

.about-intro-content,
.faq-intro-content,
.portfolio-intro-content,
.catalog-intro-content,
.gas-page-intro-content,
.coming-soon-content {
  width: min(100%, 900px);
  margin-inline: auto;
}

.about-intro-content > p,
.faq-intro-content > p,
.portfolio-intro-content > p,
.catalog-intro-content > p,
.gas-page-intro-content > p,
.coming-soon-content > p {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.75;
}

/* ---------------------------------------------------------
   RESPONSIVE GRIDS
   --------------------------------------------------------- */

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 35px);
}

.feature {
  min-width: 0;
  padding: clamp(18px, 3vw, 35px);
}

.projects-content {
  grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr);
}

.project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-card,
.portfolio-card,
.service-card {
  min-width: 0;
}

.project-card img {
  width: 100%;
  height: clamp(150px, 17vw, 210px);
  object-fit: cover;
}

.services-grid,
.portfolio-grid,
.gas-services-grid,
.catalog-grid,
.product-grid,
.team-grid,
.values-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, 260px), 1fr)
  );
  gap: clamp(18px, 3vw, 30px);
}

.service-card,
.portfolio-card,
.gas-service-card,
.catalog-card,
.product-card,
.team-card,
.value-card {
  width: 100%;
  min-width: 0;
}

.portfolio-card img,
.catalog-card img,
.product-card img,
.team-card img {
  width: 100%;
  object-fit: cover;
}

/* ---------------------------------------------------------
   FAQ
   --------------------------------------------------------- */

.faq-category {
  width: min(100%, 950px);
  margin-inline: auto;
}

.faq-category-heading {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 24px);
}

.faq-category-heading > span {
  flex: 0 0 auto;
}

.faq-list,
.faq-item {
  width: 100%;
  min-width: 0;
}

.faq-item summary {
  min-height: 52px;
  padding: clamp(16px, 2.5vw, 24px);
  cursor: pointer;
}

.faq-item > div,
.faq-item > p {
  padding-inline: clamp(16px, 2.5vw, 24px);
}

/* ---------------------------------------------------------
   FORMS AND MODALS
   --------------------------------------------------------- */

form {
  width: 100%;
  min-width: 0;
}

.form-grid,
.quote-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group,
.form-field {
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.modal,
.quote-modal {
  padding: clamp(12px, 4vw, 30px);
}

.modal-content,
.quote-modal-content {
  width: min(100%, 760px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

/* ---------------------------------------------------------
   TABLES
   --------------------------------------------------------- */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 650px;
}

/* ---------------------------------------------------------
   HVAC STRIP
   --------------------------------------------------------- */

.hvac-content {
  flex-wrap: wrap;
  gap: 18px 30px;
  text-align: center;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */

.footer-grid {
  grid-template-columns: minmax(220px, 2fr) repeat(
      3,
      minmax(140px, 1fr)
    );
  gap: clamp(24px, 4vw, 45px);
}

.footer-grid > * {
  min-width: 0;
}

.footer-logo img {
  width: min(200px, 100%);
}

footer a {
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   LARGE TABLETS AND SMALL LAPTOPS
   --------------------------------------------------------- */

@media (max-width: 1100px) {
  .main-header nav > a,
  .main-header .dropdown-btn {
    padding-inline: 11px;
    font-size: 0.8rem;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------
   MOBILE NAVIGATION
   --------------------------------------------------------- */

@media (max-width: 920px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  .main-header {
    position: sticky;
    top: 0;
    padding: 12px 0;

    box-shadow: 0 4px 18px rgba(31, 18, 10, 0.08);
  }

  .header-content {
    flex-wrap: wrap;
  }

  .logo img {
    width: clamp(145px, 38vw, 190px);
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .main-header nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;

    width: 100%;
    max-height: calc(100dvh - 105px);
    padding: 14px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background: var(--color-surface);
    border: 1px solid rgba(43, 20, 12, 0.12);
    border-radius: 10px;
    box-shadow: var(--shadow-menu);

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transform: translateY(-10px);

    transition:
      opacity 180ms ease,
      transform 180ms ease,
      visibility 180ms ease;
  }

  .main-header nav.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;

    transform: translateY(0);
  }

  .main-header nav > a,
  .main-header .dropdown-btn {
    width: 100%;
    min-height: 50px;
    padding: 13px 15px;

    justify-content: space-between;

    font-size: 1rem;
    text-align: left;
    white-space: normal;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-content {
    position: static;

    width: 100%;
    max-width: none;
    margin-top: 6px;

    box-shadow: none;

    transform: none;
  }

  .dropdown-content.show {
    max-height: 520px;

    border: 1px solid rgba(43, 20, 12, 0.1);
  }

  .dropdown-content a {
    padding-left: 24px;
  }

  .hero,
  .hero-overlay {
    min-height: clamp(470px, 75vh, 650px);
  }

  .projects-content {
    grid-template-columns: 1fr;
  }

  .projects-text {
    text-align: center;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    border-right: 0;
    border-bottom: 1px solid #ddd;
  }

  .feature:last-child {
    border-bottom: 0;
  }
}

/* ---------------------------------------------------------
   TABLETS
   --------------------------------------------------------- */

@media (max-width: 768px) {
  .hero::before {
    background-position: center center;
  }

  .hero-content {
    padding-block: 70px;
  }

  .project-grid {
    gap: 16px;
  }

  .form-grid,
  .quote-form-grid {
    grid-template-columns: 1fr;
  }

  .faq-category-heading {
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------
   PHONES
   --------------------------------------------------------- */

@media (max-width: 560px) {
  :root {
    --page-padding: 16px;
  }

  .main-header nav {
    left: -4px;
    right: -4px;
    width: auto;
  }

  .logo img {
    width: min(155px, 57vw);
  }

  .mobile-menu-toggle {
    width: 45px;
    height: 45px;
    flex-basis: 45px;
  }

  .hero h2 {
    font-size: clamp(1.85rem, 10vw, 2.75rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-buttons,
  .catalog-intro-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn,
  .catalog-intro-buttons .btn,
  .coming-soon-content .btn {
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card img {
    height: 220px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo img,
  .footer-logo p {
    margin-inline: auto;
  }

  .hvac-content {
    flex-direction: column;
  }

  .modal,
  .quote-modal {
    padding: 8px;
  }

  .modal-content,
  .quote-modal-content {
    max-height: calc(100dvh - 16px);
  }
}

/* ---------------------------------------------------------
   VERY SMALL PHONES
   --------------------------------------------------------- */

@media (max-width: 360px) {
  :root {
    --page-padding: 12px;
  }

  .logo img {
    width: 135px;
  }

  .mobile-menu-toggle {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .main-header nav > a,
  .main-header .dropdown-btn {
    font-size: 0.94rem;
  }
}

/* ---------------------------------------------------------
   LANDSCAPE PHONES
   --------------------------------------------------------- */

@media (max-height: 520px) and (orientation: landscape) {
  .main-header nav {
    max-height: calc(100dvh - 80px);
  }

  .hero,
  .hero-overlay {
    min-height: 520px;
  }
}

/* ---------------------------------------------------------
   LARGE SCREENS
   --------------------------------------------------------- */

@media (min-width: 1600px) {
  :root {
    --page-max-width: 1400px;
  }

  .hero-content {
    max-width: 1350px;
  }
}

/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}