@media (max-width: 640px) {
  /* Top bar: fixed height and padding */
  .site-header {
    height: 56px;
  }
  .site-header > .container {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 420px;
    margin-inline: auto;
  }
  .site-header > .container > .flex {
    height: 56px;
    align-items: center;
  }

  /* Global body container for mobile */
  .container {
    max-width: 420px;
    padding-left: 16px;
    padding-right: 16px;
    margin-inline: auto;
  }

  /* HERO: make image cover viewport minus header, stronger gradient, content centered & stacked */
  #hero {
    position: relative;
    min-height: calc(100vh - 56px) !important;
  }
  #hero img.absolute {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    object-fit: cover;
    object-position: center;
  }
  #hero > div[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.25) 100%
    ) !important;
  }

  /* Constrain hero content width, center vertically and horizontally on mobile */
  #hero .max-w-6xl {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10; /* above gradient */
    width: min(92%, 420px);
    padding-left: 12px;
    padding-right: 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  /* push hero text lower on mobile: align to bottom and increase bottom padding */
  #hero .mx-auto.max-w-6xl {
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
  }

  /* Heading and subtitle sizes for small screens */
  /* increase hero text size and ensure good spacing on small screens */
  #hero h1 {
    font-size: 29px !important; /* a bit larger for mobile */
    font-weight: 800 !important;
    line-height: 1.06 !important;
    margin: 0 0 6px 0;
    color: #ffffff !important;
    word-break: break-word !important;
  }
  #hero p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 14px !important;
    margin: 0 0 6px 0;
  }

  /* CTA buttons side-by-side with 8px gap, accessible touch targets */
  /* stack CTAs top-to-bottom on mobile (top → bottom) with 8px gap */
  #hero .mt-6.flex {
    gap: 10px !important;
    flex-direction: column !important;
    width: 100%;
    align-items: center;
  }
  #hero .mt-6.flex a[aria-label] {
    min-height: 44px !important;
    border-radius: 12px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    box-sizing: border-box;
  }
  /* Primary / secondary colors per spec */
  #hero a[aria-label="Explore Services"] {
    background: #4a2a1f !important;
    color: #ffffff !important;
  }
  #hero a[aria-label="Request a Quote"] {
    background: #ffffff !important;
    color: #4a2a1f !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
  }

  /* ABOUT US block: single column, card styling and readable text */
  section.py-16.bg-slate-50 > .container {
    max-width: 420px !important;
    padding-left: 16px;
    padding-right: 16px;
    margin-inline: auto;
  }
  section.py-16.bg-slate-50 .grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  /* make image a 16:9 crop and lazy-friendly style (DOM attribute not modified) */
  .py-16 .aspect-\[4\/3\] {
    aspect-ratio: 16 / 9 !important;
    overflow: hidden;
    border-radius: 1rem;
  }
  .py-16 img {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
  }

  section.py-16.bg-slate-50 h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0;
    color: #0f172a !important;
  }
  section.py-16.bg-slate-50 p.text-slate-600 {
    font-size: 15px !important;
    line-height: 1.45 !important;
    color: #475569 !important;
  }

  /* About Us CTA: full width, dark background, touch target */
  section.py-16.bg-slate-50 .mt-6 a,
  section.py-16.bg-slate-50 .mt-6 .inline-flex {
    display: block !important;
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    background: #4a2a1f !important;
    color: #ffffff !important;
    text-align: center !important;
    padding: 12px 16px !important;
    box-sizing: border-box;
  }

  /* Improve tap highlight and hit area */
  a,
  button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
  }

  /* Ensure other page sections don't exceed mobile width */
  .max-w-6xl {
    max-width: 420px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin-inline: auto !important;
  }
}
