/* Phase 4: performance and SEO-friendly layout refinements */

:root{
  --media-radius:24px;
  --media-shadow:0 12px 28px rgba(2,29,29,.08);
}

html{
  overflow-x:hidden;
}

body{
  overflow-x:hidden;
}

main,
.container,
.section,
.section-shell,
.page-hero,
.hero,
.gallery-masonry,
.projects-grid,
.video-grid,
.articles-grid,
.services-grid{
  max-width:100%;
}

img,
video,
iframe{
  max-width:100%;
  height:auto;
}

.hero__bg,
.page-hero__bg{
  background-repeat:no-repeat;
  background-size:cover;
  background-position:center;
}

.hero__bg-media{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  opacity:.3;
}

.hero__bg-media + .hero__overlay{
  position:absolute;
}

.hero__strip,
.hero__strip-track,
.trust-strip,
.stats-band,
.testimonial-carousel,
.gallery-masonry,
.projects-grid,
.video-grid{
  contain:layout style paint;
}

main > section:not(.hero):not(.page-hero):not(.trust-strip):not(.stats-band){
  content-visibility:auto;
  contain-intrinsic-size:1px 900px;
}

.hero__strip{
  min-height:166px;
}

.hero__strip-track{
  min-width:max-content;
}

.hero__strip-img,
.gallery-masonry .gitem,
.project-card,
.article-card__img,
.cert-card__img,
.service-overview-card img,
.about-photos__main img,
.about-photos__sub img{
  overflow:hidden;
}

.projects-grid img,
.gallery-masonry img,
.article-card__img img,
.cert-card__img img,
.service-overview-card img{
  aspect-ratio:auto;
}

.video-card video{
  width:100%;
  aspect-ratio:9 / 16;
  background:linear-gradient(180deg,#082420,#061a18);
  border-radius:20px;
}

.contact-map,
.footer-map{
  min-height:260px;
}

.contact-map iframe,
.footer-map iframe{
  width:100%;
  min-height:260px;
  aspect-ratio:16 / 10;
  border:0;
  display:block;
}

.scroll-progress{
  will-change:transform;
}

.reveal,
.stagger-item{
  will-change:transform, opacity;
}

@media (max-width: 991px){
  .hero__glow,
  .hero::before,
  .page-hero::before{
    animation:none !important;
  }

  .hero__strip::before,
  .hero__strip::after{
    width:42px;
  }

  .trust-strip__panel,
  .hero__card,
  .service-card,
  .article-card,
  .project-card,
  .cert-card{
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
  }
}

@media (max-width: 768px){
  .page-hero[style*="background-attachment:fixed"]{
    background-attachment:scroll !important;
  }

  .hero__bg-media{
    opacity:.22;
  }

  .hero__strip{
    min-height:132px;
  }

  .hero__strip-img{
    min-width:168px;
    height:118px;
  }

  main > section:not(.hero):not(.page-hero):not(.trust-strip):not(.stats-band){
    contain-intrinsic-size:1px 720px;
  }
}

@media (prefers-reduced-motion: reduce){
  .hero__strip-track,
  .hero__glow,
  .hero::before,
  .page-hero::before{
    animation:none !important;
  }
}
