/* Shared responsive polish for the public site. */

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

img,
svg,
iframe {
  max-width: 100%;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

main {
  width: 100%;
}

section,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 640px;
}

@media (max-width: 760px) {
  .home-page main {
    padding-top: 0;
    padding-bottom: 0;
  }

  .home-page .hero {
    background-image: linear-gradient(90deg, rgba(7, 27, 46, .96) 0%, rgba(7, 27, 46, .8) 58%, rgba(7, 27, 46, .36) 100%), url("working2-mobile.jpg") !important;
  }

  .about-page .hero .image {
    background-image: url("beforeandafterimg-mobile.jpg") !important;
  }

  .before-after-image,
  .image.before-after-image {
    background-image: url("beforeandafterimg-mobile.jpg") !important;
  }

  .projects-grid > .project:first-child {
    background-image: linear-gradient(0deg, rgba(7, 27, 46, .92), transparent 70%), url("img1-optimized.jpg") !important;
  }

  .project-stack .project:first-child {
    background-image: linear-gradient(0deg, rgba(7, 27, 46, .92), transparent 70%), url("work2-mobile.jpg") !important;
  }

  .project-stack .project:nth-child(2) {
    background-image: linear-gradient(0deg, rgba(7, 27, 46, .92), transparent 70%), url("work4-mobile.jpg") !important;
  }

  .feature-card {
    background-image: linear-gradient(0deg, rgba(7, 27, 46, .9), transparent 75%), url("working1-mobile.jpg") !important;
  }

  .i1 { background-image: url("work1-mobile.jpg") !important; }
  .i2 { background-image: url("work2-mobile.jpg") !important; }
  .i3 { background-image: url("working1-mobile.jpg") !important; }
  .i6 { background-image: url("work6-mobile.jpg") !important; }
  .i15 { background-image: url("work4-mobile.jpg") !important; }
  .i16 { background-image: url("work5-mobile.jpg") !important; }
  .i18 { background-image: url("working2-mobile.jpg") !important; }

  .site-footer .map-frame { height: 220px; }
}

.site-header .site-nav {
  padding-inline: 0;
}

.site-navigation {
  flex-wrap: nowrap;
}

.site-footer .footer-row {
  align-items: center;
}

form {
  min-width: 0;
}

input,
select,
textarea {
  max-width: 100%;
}

@media (max-width: 1100px) {
  .site-header .site-nav {
    gap: 16px;
  }

  .site-logo {
    width: 136px;
  }

  .site-navigation {
    gap: 14px;
    font-size: 13px;
  }

  .site-header .site-cta {
    padding-inline: 16px;
  }

  .split,
  .contact-grid,
  .quote-grid {
    gap: 48px;
  }

  .featured-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .container {
    width: min(var(--max, 1180px), calc(100% - 40px));
  }

  .cards,
  .grid,
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credibility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    gap: 42px;
  }

  .featured-grid {
    grid-template-columns: 1.1fr .9fr;
  }

  .project,
  .feature-card {
    min-height: 300px;
  }

  .projects-grid > .project:first-child {
    min-height: 390px;
  }
}

@media (max-width: 900px) {
  .site-header .site-nav {
    min-height: 76px;
  }

  .site-navigation {
    overflow-y: auto;
  }

  .section-intro {
    display: block;
  }

  .section-intro p {
    max-width: 620px;
    margin-top: 16px;
  }

  .contact-grid,
  .quote-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .contact-copy,
  .quote-grid > section {
    max-width: 760px;
  }

  form {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .container {
    width: calc(100% - 34px);
  }

  .site-header .site-nav {
    min-height: 68px;
  }

  .site-logo {
    width: 126px;
    height: 52px;
  }

  .top {
    padding: 8px 17px;
  }

  .top-call {
    min-width: 88px;
    padding: 8px 13px;
  }

  .hero-content {
    padding: 64px 0;
  }

  .hero h1,
  main h1 {
    font-size: clamp(36px, 11vw, 56px);
    line-height: 1.03;
    letter-spacing: -1.5px;
  }

  h2 {
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.08;
    letter-spacing: -1px;
  }

  section {
    padding: 64px 0;
  }

  main {
    padding-top: 54px;
    padding-bottom: 64px;
  }

  .hero,
  .split,
  .cards,
  .grid,
  .projects-grid,
  .contact-grid,
  .quote-grid,
  .values,
  .featured-grid,
  .gallery {
    grid-template-columns: 1fr;
  }

  .hero,
  .split,
  .contact-grid,
  .quote-grid {
    gap: 32px;
  }

  .feature-images,
  .image {
    min-height: 0;
  }

  .before-after-image,
  .image {
    aspect-ratio: 4 / 3;
  }

  .metrics-grid,
  .credibility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric,
  .credibility-grid > div {
    padding: 20px 16px;
  }

  .cards,
  .grid,
  .gallery {
    gap: 16px;
  }

  .card,
  .feature-facts,
  form {
    padding: 22px;
  }

  .actions {
    gap: 10px;
  }

  .actions .button {
    flex: 1 1 160px;
    text-align: center;
  }

  .filters .container {
    gap: 8px;
  }

  .filter {
    flex: 1 1 auto;
    text-align: center;
  }

  .site-footer .footer-row {
    align-items: flex-start;
  }

  .floating-actions {
    right: 14px;
    bottom: 14px;
    gap: 8px;
  }

  .floating-action {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 420px) {
  .container {
    width: calc(100% - 28px);
  }

  .metrics-grid,
  .credibility-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .credibility-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child,
  .credibility-grid > div:last-child {
    border-bottom: 0;
  }

  .actions .button,
  .site-header .site-cta {
    width: 100%;
  }

  form {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
