/* V160 — global spacing, section proportion and footer system.
   Loaded last. No content, illustration artwork or interaction logic changes. */

:root {
  --v160-section-desktop: clamp(68px, 5.8vw, 88px);
  --v160-section-tablet: 58px;
  --v160-section-mobile: 46px;
  --v160-section-gap: clamp(34px, 4.2vw, 54px);
}

/* Anchor targets should arrive below the fixed header rather than half-hidden. */
main [id],
.service-detail[id] {
  scroll-margin-top: calc(var(--header) + 24px);
}

/* Shared editorial spacing. */
body.visual-audit-v103.content-page .section,
body.production-audit-v129:not(.home-v143) .section {
  padding-top: var(--v160-section-desktop) !important;
  padding-bottom: var(--v160-section-desktop) !important;
}

body.visual-audit-v103 .section-head {
  margin-bottom: var(--v160-section-gap) !important;
}

/* A single hero composition should sit comfortably inside a laptop viewport.
   Dense project information and galleries remain naturally scrollable. */
body.visual-audit-v103 .page-hero {
  min-height: min(700px, calc(100svh - 18px)) !important;
  padding-top: calc(var(--header) + 38px) !important;
  padding-bottom: 40px !important;
  gap: clamp(38px, 5vw, 72px) !important;
}

body.visual-audit-v103 .page-hero__media img {
  max-height: min(60svh, 620px) !important;
}

/* Process stages: same media geometry and enough compression to keep each
   mobile stage close to one coherent viewport without hiding information. */
body.content-page .process-phase {
  padding-top: clamp(54px, 5.5vw, 78px) !important;
  padding-bottom: clamp(54px, 5.5vw, 78px) !important;
  gap: clamp(42px, 6vw, 82px) !important;
}

body.content-page .process-phase__media--illustration {
  justify-self: center;
}

/* Compact conversion sections; remove inherited full-screen tendencies. */
body.visual-audit-v103 .page-cta {
  min-height: 0 !important;
  padding-top: clamp(68px, 6vw, 88px) !important;
  padding-bottom: clamp(68px, 6vw, 88px) !important;
}

body.visual-audit-v103 .page-cta h2 {
  margin-bottom: 30px !important;
}

/* ----------------------------------------------------------------------
   Global footer: identical, compact proportions on every route.
   The old SVG was 652px high and several pages allowed that intrinsic height
   to define the footer. The image is now explicitly contained.
   ---------------------------------------------------------------------- */
body .site-footer {
  box-sizing: border-box !important;
  width: min(100%, 1440px) !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 20px var(--pad) 18px !important;
  grid-template-columns: 68px minmax(280px, 1fr) minmax(190px, .52fr) auto !important;
  align-items: center !important;
  gap: clamp(18px, 2.4vw, 34px) !important;
  overflow: hidden !important;
}

body .footer-logo {
  display: block !important;
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  min-height: 68px !important;
  max-width: 68px !important;
  max-height: 68px !important;
  align-self: center !important;
  overflow: hidden !important;
}

body .footer-logo img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

body .footer-links,
body .footer-contact,
body .footer-copy,
body .site-footer > p:last-child {
  min-width: 0 !important;
  align-self: center !important;
  margin: 0 !important;
}

body .footer-links {
  gap: 2px 16px !important;
}

body .site-footer a:not(.footer-logo) {
  display: inline-flex !important;
  min-height: 28px !important;
  align-items: center !important;
}

/* Controls that are not inline prose links meet the current WCAG 2.2 AA
   pointer-target minimum, with 44px used for primary/navigation controls. */
.project-end__actions a,
.project-nav a,
.simple-carousel__control,
.menu-toggle,
.contact-form summary,
.projects-view-controls button,
.project-filter button {
  min-height: 44px !important;
}

.journey-text-link,
.simple-work__all {
  min-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
}

@media (max-width: 1080px) and (min-width: 721px) {
  body.visual-audit-v103.content-page .section,
  body.production-audit-v129:not(.home-v143) .section {
    padding-top: var(--v160-section-tablet) !important;
    padding-bottom: var(--v160-section-tablet) !important;
  }

  body .site-footer {
    padding-top: 20px !important;
    padding-bottom: 18px !important;
    grid-template-columns: 64px minmax(0, 1fr) minmax(180px, .65fr) !important;
    gap: 16px 26px !important;
  }

  body .footer-logo {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
  }

  body .footer-copy,
  body .site-footer > p:last-child {
    grid-column: 2 / -1 !important;
    justify-self: start !important;
    text-align: left !important;
  }
}

@media (max-width: 720px) {
  body.visual-audit-v103.content-page .section,
  body.production-audit-v129:not(.home-v143) .section {
    padding-top: var(--v160-section-mobile) !important;
    padding-bottom: var(--v160-section-mobile) !important;
  }

  body.visual-audit-v103 .section-head {
    margin-bottom: 30px !important;
  }

  body.visual-audit-v103 .page-hero {
    min-height: 0 !important;
    padding-top: calc(var(--header) + 30px) !important;
    padding-bottom: 42px !important;
    gap: 30px !important;
  }

  body.visual-audit-v103 .page-hero__media,
  body.visual-audit-v103 .page-hero__media--rendered-plan,
  body.visual-audit-v103 .studio-hero-illustration,
  body.visual-audit-v103 .services-hero-mosaic {
    width: min(100%, 332px) !important;
    max-width: 332px !important;
    justify-self: center !important;
  }

  body.visual-audit-v103 .page-hero__media img {
    width: 100% !important;
    height: auto !important;
    max-height: 350px !important;
    object-fit: contain !important;
  }

  body.content-page .process-phase {
    padding-top: 42px !important;
    padding-bottom: 46px !important;
    gap: 28px !important;
  }

  body.content-page .process-phase__media--illustration,
  body.content-page .process-phase__media--illustration picture {
    width: min(100%, 316px) !important;
    max-width: 316px !important;
    margin-inline: auto !important;
  }

  body.visual-audit-v103 .page-cta {
    padding-top: 54px !important;
    padding-bottom: 58px !important;
  }

  /* Contact opening: retain the authored illustration, but prevent one image
     from turning the opening into a 1.3-screen composition. */
  body.content-page .contact-page--single {
    padding-top: calc(var(--header) + 30px) !important;
    padding-bottom: 48px !important;
    gap: 30px !important;
  }

  body.content-page .contact-page__media {
    width: min(100%, 310px) !important;
    max-width: 310px !important;
    justify-self: center !important;
  }

  /* Project opening media can shrink, but facts and project identity remain. */
  body.project-page .project-hero__media,
  body.project-page .project-matrix--detail {
    width: min(100%, 330px) !important;
    max-width: 330px !important;
    justify-self: center !important;
  }

  body .site-footer {
    padding-top: 18px !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 10px !important;
  }

  body .footer-logo {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    max-width: 54px !important;
    max-height: 54px !important;
    align-self: start !important;
  }

  body .footer-links {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 0 12px !important;
  }

  body .footer-links a,
  body .footer-contact a {
    min-height: 28px !important;
  }

  body .footer-contact,
  body .footer-copy,
  body .site-footer > p:last-child {
    grid-column: auto !important;
    justify-self: start !important;
    align-self: start !important;
    text-align: left !important;
    white-space: normal !important;
  }
}

@media (max-width: 360px) {
  body .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Final mobile calibration after rendered section-by-section measurement. */
@media (max-width: 720px) {
  /* Six authored service images remain visible, arranged 3 × 2 so the opening
     fits as one composition rather than stretching past the viewport. */
  body.content-page .services-hero-mosaic--illustrations {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    width: min(100%, 332px) !important;
    height: auto !important;
    aspect-ratio: 3 / 2 !important;
    gap: 5px !important;
  }

  body.content-page .services-hero-mosaic--illustrations figure,
  body.content-page .services-hero-mosaic--illustrations .services-hero-mosaic__link {
    min-width: 0 !important;
    aspect-ratio: 1 / 1 !important;
  }

  body.content-page .services-hero-mosaic--illustrations img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  body.content-page .page-hero--process .page-hero__media,
  body.content-page .page-hero--studio .page-hero__media {
    width: min(100%, 300px) !important;
    max-width: 300px !important;
  }

  body.content-page .contact-page__media {
    width: min(100%, 260px) !important;
    max-width: 260px !important;
  }

  body.project-page .project-hero__media,
  body.project-page .project-matrix--detail {
    width: min(100%, 280px) !important;
    max-width: 280px !important;
  }

  /* Four Process stages preserve every line of copy and every output, but use
     mobile-specific editorial spacing so each stage reads as one chapter. */
  body.content-page .process-phase__copy h2 {
    margin-top: 12px !important;
    margin-bottom: 18px !important;
    font-size: clamp(30px, 8.6vw, 38px) !important;
    line-height: 1.02 !important;
  }

  body.content-page .process-phase__copy > p:not(.section-index) {
    font-size: 15px !important;
    line-height: 1.58 !important;
  }

  body.content-page .process-phase__copy h3 {
    margin-top: 20px !important;
    margin-bottom: 6px !important;
  }

  body.content-page .process-phase__copy li {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  body.content-page .process-phase__media--illustration,
  body.content-page .process-phase__media--illustration picture {
    width: min(100%, 280px) !important;
    max-width: 280px !important;
  }

  body.content-page .process-phase__media--illustration figcaption {
    margin-top: 8px !important;
  }
}

/* Final narrow-screen fit: keep single-composition openings and each Process
   stage understandable without a corrective half-scroll on a 390 × 844 screen. */
@media (max-width: 720px) {
  body.content-page .page-hero--studio,
  body.content-page .page-hero--process,
  body.content-page .page-hero--services {
    padding-top: calc(var(--header) + 18px) !important;
    padding-bottom: 34px !important;
    gap: 24px !important;
  }

  body.content-page .page-hero--studio .page-hero__media {
    width: min(100%, 300px) !important;
    height: 300px !important;
    max-height: 300px !important;
    overflow: hidden !important;
  }

  body.content-page .page-hero--studio .page-hero__media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  body.content-page .contact-page--single {
    padding-top: calc(var(--header) + 18px) !important;
    padding-bottom: 36px !important;
    gap: 24px !important;
  }

  body.content-page .contact-page__intro h1 {
    font-size: clamp(40px, 11vw, 48px) !important;
    line-height: .98 !important;
  }

  body.content-page .contact-page__media {
    width: min(100%, 240px) !important;
    max-width: 240px !important;
  }

  body.project-page .project-hero {
    padding-top: calc(var(--header) + 18px) !important;
    padding-bottom: 30px !important;
    gap: 20px !important;
  }

  body.project-page .project-hero__media,
  body.project-page .project-matrix--detail {
    width: min(100%, 260px) !important;
    max-width: 260px !important;
  }

  body.content-page .process-phase {
    padding-top: 30px !important;
    padding-bottom: 34px !important;
    gap: 20px !important;
  }

  body.content-page .process-phase__media--illustration,
  body.content-page .process-phase__media--illustration picture {
    width: min(100%, 240px) !important;
    max-width: 240px !important;
  }
}
@media (max-width: 720px) {
  body.project-page .project-hero {
    padding-top: calc(var(--header) + 12px) !important;
    padding-bottom: 24px !important;
  }
}

/* Navigation target sizing. */
.site-nav > a {
  display: inline-flex !important;
  min-height: 28px !important;
  align-items: center !important;
}

.project-nav-footer a {
  display: inline-flex !important;
  min-height: 44px !important;
  align-items: center !important;
}

@media (max-width: 720px) {
  body.content-page .process-phase__media--illustration {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  body.content-page .process-phase__media--illustration picture {
    width: 240px !important;
    max-width: 240px !important;
    margin-inline: auto !important;
  }

  body.content-page .process-phase__media--illustration figcaption {
    width: 100% !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
}
@media (max-width: 720px) {
  body.project-page .project-hero {
    padding-top: calc(var(--header) + 10px) !important;
    padding-bottom: 22px !important;
  }
}
