/*--------------------------------------
  LEGEND AIR HVAC - CLEANED & OPTIMIZED CSS
--------------------------------------*/

@layer base, components, utilities;

/*-------------------------
  BASE
-------------------------*/
@layer base {
  :root {
    /* Brand Palette */
    --primary: #9b0000;
    --primary-alt: #7a0000;
    --secondary: #0a2e5c;
    --accent: #00a8ff;
    /* Neutrals */
    --dark: #0f172a;
    --dark-offset: #1e293b;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
    /* Shapes & Shadows */
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.15);
   
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
  }
  body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark-offset);
    background-color: var(--white);
    background-image: radial-gradient(var(--border) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.15;
    color: var(--dark);
    letter-spacing: -0.025em;
    text-wrap: balance;
  }
  a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
  }
}
/*-------------------------
  COMPONENTS
-------------------------*/
@layer components {
  /* Container */
  .container {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 2rem;
  }
  /* Sections */
  .section { padding-block: 100px; }
  .section-alt { background-color: var(--light-gray); padding-block: 100px; }
  .section-dark { background-color: var(--dark); color: var(--white); padding-block: 100px; }
  /* Tight Section for Services Icons */
  .section-tight-top { padding-top: 40px; }
  /* Cards */
  .card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  .card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--secondary);
    transition: var(--transition);
  }
  .card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
  }
  .card:hover::before { background: var(--primary); }
  /* Buttons */
  .btn {
    display: inline-flex;
    padding: 1.125rem 2.25rem;
    font-weight: 700;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    transition: var(--transition);
  }
  .btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 20px -10px rgba(155,0,0,0.5);
  }
  .btn-primary:hover {
    background: var(--primary-alt);
    transform: scale(1.02);
  }
  /* Header */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(10px);
    transition: background 0.3s, padding 0.3s;
  }
  .site-header .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 6px 1rem;
    width: 100%;
  }
  .site-header .header-top a { color: #fff; font-weight: 700; }
  .site-header .header-top a:hover { color: var(--accent); }
  .site-header nav.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 110px;
    padding-inline: 1rem;
    position: sticky;
    top: 0;
  }
  .site-header .logo {
    display: flex;
    align-items: center;
    gap: 25px;
  }
  .site-header .logo img {
    height: 80px;
    width: auto;
    transition: transform 0.3s;
  }
  .site-header .logo img:hover { transform: scale(1.05); }
  .site-header .logo span {
    display: block;
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
  }
  .site-header nav.nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .site-header nav.nav ul li a { color: #fff; transition: var(--transition); }
  .site-header nav.nav ul li a:hover { color: var(--accent); transform: translateY(-2px); }
  /*--------------------------------------
  MOBILE MENU CONTROLS & SLIDE ANIMATION
--------------------------------------*/
  #mobile-menu {
    position: fixed;
    top: 110px; /* match nav height */
    left: 0;
    width: 100%;
    height: calc(100vh - 110px);
    background: rgba(15, 23, 42, 0.95);
    padding: 30px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 25px;
    opacity: 0; /* hidden initially */
    transform: translateY(-20px); /* start slightly above */
    pointer-events: none; /* prevent clicks when hidden */
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease; /* smooth slide */
  }
  /* Show mobile menu when open */
  #mobile-menu.open {
    opacity: 1;
    transform: translateY(0); /* slide down into view */
    pointer-events: auto; /* allow clicks */
  }
   
  /* Hero Section */
  .hero-with-bg {
    position: relative;
    overflow: hidden;
    padding-block: 150px;
    text-align: center;
    color: var(--white);
  }
  .hero-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.35;
    z-index: 0;
    transition: transform 0.5s ease;
  }
  .hero-bg-image:hover { transform: scale(1.05); }
  .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(15,23,42,0.85) 0%,
      rgba(15,23,42,0.75) 50%,
      rgba(15,23,42,0.85) 100%
    );
    z-index: 1;
  }
  .hero-content {
    position: relative;
    z-index: 2;
  }
  .hero-content h1, .hero-content p {
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  }
  .hero-content h1 {
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--white);
  }
  .hero-content p {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
  }
  .hero-content .highlight-red { color: var(--primary); }
  .hero-content .highlight-blue { color: var(--accent); }
  .hero-content .btn { margin-top: 12px; }
   
  /*--------------------------------------
  MOBILE MENU
--------------------------------------*/
  #mobile-menu,
  #mobile-menu-toggle {
    display: none;
  }
  /* Mobile behavior */
@media (max-width: 768px) {
  /* Hamburger button */
  #mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
  }
  /* Hide desktop */
  .desktop-menu,
  .nav .btn {
    display: none !important;
  }
  /* Mobile menu container */
  #mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    position: fixed;
    top: 110px;
    left: 0;
    width: 100%;
    height: calc(100vh - 110px);
    background: rgba(15, 23, 42, 0.95);
    padding: 30px 20px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  #mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  /* Menu list */
  .mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: center;
  }
  .mobile-menu-list li {
    position: relative;
    margin-bottom: 25px;
  }
  .mobile-menu-list li a {
    display: block;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    z-index: 1;
  }
  .mobile-menu-list li a:hover {
    color: var(--accent);
  }
  /* Arrow toggle (separate from link) */
  .submenu-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: #fff;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.3s ease;
  }
  /* Submenu hidden state */
  .sub-menu {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  /* Submenu open */
  .sub-menu.open {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
  }
  /* Rotate arrow when open */
  .menu-item-has-children.open > .submenu-toggle {
    transform: translateY(-50%) rotate(180deg);
  }
    /* Mobile CTA button */
    .mobile-cta {
      margin-top: 40px;
      width: 100%;
    }
    .mobile-cta a {
      background: var(--primary);
      color: #fff;
      padding: 16px 32px;
      border-radius: var(--radius);
      font-weight: 700;
      display: block;
      text-align: center;
      transition: background 0.3s, transform 0.2s;
    }
    .mobile-cta a:hover {
      background: var(--primary-alt);
      transform: scale(1.02);
    }
    h1, h2, h3, h4 {
      font-size: 1.5rem; /* reduce font size for headings */
    }
    p {
      font-size: 1rem; /* reduce font size for paragraphs */
    }
    .grid-2, .grid-3, .grid-4 {
      grid-template-columns: 1fr; /* use a single column for mobile devices */
    }
    .container {
      padding-inline: 1rem; /* reduce padding for container */
    }
    .card {
      padding: 1rem; /* reduce padding for cards */
    }
    .section {
      padding-block: 2rem; /* reduce padding for sections */
    }
    .image-warning {
      display: none; /* hide image warning for mobile devices */
    }
  }
  /* Services Icons Grid */
  .services-grid { margin-top: 40px; }
  .service-card { text-align: center; }
  .service-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--secondary);
    transition: var(--transition);
  }
  .service-card:hover .service-icon {
    color: var(--primary);
    transform: scale(1.1);
  }
  /* Footer */
  .site-footer {
    background: var(--dark);
    border-top: 4px solid var(--primary);
    color: var(--light-gray);
    font-size: 0.9rem;
    line-height: 1.4;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-block: 20px;
  }
  .site-footer .footer-stripe {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
  }
  .site-header a { color: var(--light-gray); transition: var(--transition); }
  .site-header a:hover { color: var(--accent); transform: translateY(-2px); }
  .site-footer .footer-cities {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .site-footer .footer-cities a {
    display: inline-block;
    background: var(--secondary);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 25px;
    font-size: 0.8rem;
  }
  .site-footer .footer-cities a:hover {
    background: var(--primary);
    transform: translateY(-2px);
  }
  .site-footer .footer-copy { text-align: center; font-size: 0.8rem; padding-top: 5px; }
  /* Mobile Call/Contact */
  .footer-mobile-actions {
    display: none;
  }
  @media (max-width: 768px) {
    .footer-mobile-actions {
      display: flex;
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background: var(--primary);
      padding: 10px 15px;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }
    .footer-mobile-actions a {
      color: var(--white);
      font-weight: 700;
      font-size: 1rem;
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 0 20px;
      position: relative;
    }
    .footer-mobile-actions a:hover {
      opacity: 0.9;
      transform: translateY(-1px);
    }
    .footer-mobile-actions a:first-child::after {
      content: '';
      position: absolute;
      width: 1px;
      height: 50%;
      background: rgba(255,255,255,0.5);
      right: -10px;
      top: 25%;
    }
  }
}
/*-------------------------
  UTILITIES
-------------------------*/
@layer utilities {
  .text-center { text-align: center; }
  .grid { display: grid; gap: 2.5rem; }
  .grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
  .grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4,1fr); gap:2.5rem; }
  @media (max-width:1024px){ .grid-4 { grid-template-columns: repeat(2,1fr); } }
  @media (max-width:768px){ .grid-4 { grid-template-columns: 1fr; } }
}
  /* Trusted HVAC Section */
.trusted-hvac {
  padding-block: 80px;
}
.trusted-hvac .trusted-image img {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: transform 0.4s;
}
.trusted-hvac .trusted-image img:hover {
  transform: scale(1.02);
}
.trusted-hvac .trusted-text h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  color: var(--dark);
}
.trusted-hvac .trusted-text p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: var(--dark-offset);
}
.trusted-hvac .trusted-features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}
.trusted-hvac .trusted-features li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--secondary);
}
.trusted-hvac .trusted-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: bold;
}
.trusted-hvac .btn {
  margin-top: 0.5rem;
}
/* Responsive Grid for Mobile */
@media (max-width: 768px) {
  .trusted-hvac .grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
 
.header-socials .social-icon i {
    color: #fff; /* force white */
    font-size: 1rem;
    transition: color 0.3s;
}
.header-socials .social-icon:hover i {
    color: var(--primary); /* optional hover effect */
}
 
/*--------------------------------------
  Quote + Reviews Section
--------------------------------------*/
.section-quote-reviews {
  padding: 60px 0;
  background: var(--dark); /* matches top bar */
}
.section-quote-reviews .grid-2 {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  align-items: stretch;
}
/* Cards Styling */
.quote-card,
.reviews-card {
  flex: 1 1 500px;
  background: var(--dark);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-lg);
  padding: 60px 40px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
  border-radius: var(--radius);
}
/* Hover "bounce" effect */
.quote-card:hover,
.reviews-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
/* Headings */
.quote-card h2,
.reviews-card h2 {
  font-size: 2.25rem;
  margin-bottom: 25px;
  color: var(--white);
  line-height: 1.2;
}
/* Paragraphs */
.quote-card p,
.reviews-card p {
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 25px;
  color: #f1f5f9;
}
/* Subtext for Quote Card */
.quote-card .sub-text {
  font-size: 1.1rem;
  color: #e0e0e0;
  margin-bottom: 30px;
}
/* Buttons */
.quote-card .btn,
.reviews-card .btn {
  font-size: 1.2rem;
  padding: 18px 50px;
  align-self: flex-start;
  transition: var(--transition);
}
.quote-card .btn:hover,
.reviews-card .btn:hover {
  transform: scale(1.03);
}
/* Align Reviews Button Center */
.reviews-card .btn {
  align-self: center;
}
/* Responsive */
@media (max-width: 1024px) {
  .section-quote-reviews .grid-2 {
    gap: 30px;
  }
}
@media (max-width: 768px) {
  .section-quote-reviews .grid-2 {
    flex-direction: column;
  }
  .quote-card .btn,
  .reviews-card .btn {
    align-self: center;
  }
}
  .section-quote-reviews .feature-line {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}
  .trusted-image {
  position: relative;
}
.trusted-image .image-warning {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(155,0,0,0.9); /* use primary color with transparency */
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  padding: 10px 15px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
  /* Trusted Image Tint without affecting overlay text */
.trusted-image {
  position: relative;
  overflow: hidden;
}
/* Tint ONLY the image, not the warning text */
.trusted-image img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 0;
  /* Tint using a pseudo element with mix-blend-mode */
}
.trusted-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35); /* mild dark blue tint */
  mix-blend-mode: multiply; /* ensures text on top is unaffected */
  pointer-events: none;
  z-index: 1;
}
/* Warning text on top */
.image-warning {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px 20px;
  background: rgba(155, 0, 0, 0.85); /* subtle dark red for contrast */
  color: #fff;
  font-weight: 700;
  text-align: center;
  font-size: 1rem;
  z-index: 2;
  line-height: 1.4;
}
.card-pledge { border: 3px dashed var(--primary); text-align: center; margin-top: 60px; }
.text-highlight { color: var(--primary); font-weight: 800; }
.text-accent { color: var(--accent); }
.align-center { align-items: center; }
   
/* Utility & Layout Helpers */
.mt-32 { margin-top: 2rem; }
.mb-32 { margin-bottom: 2rem; }
.mb-50 { margin-bottom: 50px; }
.text-white { color: var(--white); }
/* The Service Area Dark Cards */
.card-dark {
    background: var(--dark-offset);
    padding: 1.5rem;
    border: none;
}
.card-dark h4 { color: var(--accent); margin-bottom: 0.5rem; }
.card-dark p { color: var(--light-gray); font-size: 0.95rem; }
/* The Satisfaction Pledge Box */
.card-pledge {
    margin-top: 80px;
    border: 3px dashed var(--primary);
    text-align: center;
}
.card-pledge p.pledge-text {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--dark);
    margin-block: 20px;
}

/*==========================
  SUBMENU / CHILD MENU SUPPORT
==========================*/
/* DESKTOP: Hide submenus by default + show only on hover */
.desktop-menu .sub-menu,
.site-header .desktop-menu .sub-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    padding: 12px 0;
    z-index: 1100;
    border: 1px solid rgba(255,255,255,0.1);
    animation: fadeInDown 0.25s ease forwards;
}
.desktop-menu .menu-item-has-children,
.site-header .desktop-menu .menu-item-has-children {
    position: relative;
}
.desktop-menu .menu-item-has-children:hover > .sub-menu,
.site-header .desktop-menu .menu-item-has-children:hover > .sub-menu {
    display: block !important;
}
/* Submenu items styling */
.desktop-menu .sub-menu li a,
.site-header .desktop-menu .sub-menu li a {
    display: block;
    padding: 12px 24px;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.2s;
}
.desktop-menu .sub-menu li a:hover,
.site-header .desktop-menu .sub-menu li a:hover {
    background: var(--primary);
    color: #fff;
    padding-left: 30px;
}
/* Small down-arrow on parent items */
.desktop-menu .menu-item-has-children > a::after,
.site-header .desktop-menu .menu-item-has-children > a::after {
    content: " ▼";
    font-size: 0.75rem;
    margin-left: 6px;
    opacity: 0.7;
}
/* Smooth fade animation for desktop dropdown */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

