/* Match Projects: native page snapping below the floating navigation.
   Minimum heights keep long copy and expanded notes naturally scrollable. */
html:has(body[data-theme-page='home']),
html:has(body[data-theme-page='about']),
html:has(body[data-theme-page='hvac-solutions']),
html:has(body[data-theme-page='services']),
html:has(body[data-theme-page='our-approach']) {
  --section-view-top:108px;
  --section-view-bottom:24px;
  scroll-padding-top:var(--section-view-top);
}
html:has(body[data-theme-page='home']),
html:has(body[data-theme-page='about']),
html:has(body[data-theme-page='hvac-solutions']) {
  scroll-snap-type:y mandatory;
}
body[data-theme-page='hvac-solutions'] :is(.hero,.jump-strip,#commercial,#residential,#enquiry,.footer) {
  scroll-snap-align:start;
  scroll-margin-top:0;
}
body[data-theme-page='home'] main>section,
body[data-theme-page='about'] main>section {
  min-height:calc(100svh - var(--section-view-top) - var(--section-view-bottom));
  scroll-snap-align:start;
  scroll-snap-stop:always;
  scroll-margin-top:0;
}
body[data-theme-page='home'] main>section:not(#hero),
body[data-theme-page='about'] main>section {
  display:grid;
  align-content:center;
}
body[data-theme-page='home'] .footer,
body[data-theme-page='about'] .footer { scroll-snap-align:start; }
body[data-theme-page='services'] :is(.hero,.offering-intro,.offer-row,.scope-foot,#amc,#enquiry,.footer),
body[data-theme-page='our-approach'] :is(.approach-opening,.stage-index,.stage-section,#project-info,#enquiry,.footer) {
  scroll-snap-align:start;
  scroll-margin-top:0;
}
body[data-theme-page='services'] #offerings .offer-row {
  min-height:calc(100svh - var(--section-view-top) - var(--section-view-bottom));
  scroll-snap-stop:always;
  padding-block:32px;
}
body[data-theme-page='our-approach'] .stage-section {
  min-height:calc(100svh - var(--section-view-top) - var(--section-view-bottom));
  scroll-snap-stop:always;
  display:grid;
  align-content:center;
}
body[data-theme-page='our-approach'] .stage-section>.wrap { width:min(1280px, calc(100% - var(--site-gutter) * 2)); }
.partner-role-controls { display:none; }
@media(min-width:901px) {
  body[data-theme-page='hvac-solutions'] :is(#commercial,#residential) { scroll-snap-align:none; }
  body[data-theme-page='hvac-solutions'] [data-topic-stage] { scroll-snap-align:start;scroll-snap-stop:always;scroll-margin:0; }
  body.responsive[data-theme-page='services'] #offerings .offer-row { align-items:center; }
  body.responsive[data-theme-page='services'] #offerings .offer-copy { align-self:center; }
  body.responsive[data-theme-page='services'] #offerings .offer-visual { align-self:center; }
  body.responsive[data-theme-page='services'] #offerings .service-photo { height:clamp(340px,54svh,560px);flex:none; }
}
@media(max-width:900px) {
  html:has(body[data-theme-page='home']),
  html:has(body[data-theme-page='about']),
  html:has(body[data-theme-page='hvac-solutions']),
  html:has(body[data-theme-page='services']),
  html:has(body[data-theme-page='our-approach']),
  html:has(body[data-theme-page='partner-with-us']) {
    --section-view-top:92px;
    --section-view-bottom:16px;
    scroll-padding-top:var(--section-view-top);
    scroll-snap-type:y mandatory;
  }
  body[data-theme-page='hvac-solutions'] :is(.hero,.jump-strip,#commercial,#residential,#enquiry,.footer) {
    scroll-snap-align:start;
    scroll-margin-top:0;
  }
  body.responsive[data-theme-page='hvac-solutions'] :is(#commercial,#residential) .section-intro {
    top:var(--section-view-top);
    background:var(--surface)!important;
    z-index:26;
  }
  body[data-theme-page='hvac-solutions'] .application-item {
    scroll-snap-align:start;
    scroll-margin-top:var(--topic-heading-height,54px);
  }
  body[data-theme-page='hvac-solutions'] .application-item:has(.application-panel:not([hidden])) {
    min-height:calc(100svh - var(--section-view-top) - var(--topic-heading-height,54px) - var(--section-view-bottom));
    scroll-snap-stop:always;
  }
  body.responsive[data-theme-page='hvac-solutions'] :is(#commercial,#residential) .application-panel {
    height:auto;
    min-height:0;
  }
  body[data-theme-page='services'] #offerings .offer-row { padding-block:24px;align-content:center;gap:24px; }
  body[data-theme-page='services'] #offerings .service-photo { max-height:220px;aspect-ratio:1.8; }
  body.responsive[data-theme-page='our-approach'] .stage-section .approach-photo { height:clamp(150px,23svh,220px);aspect-ratio:auto; }
  body[data-theme-page='partner-with-us'] main>.section {
    min-height:calc(100svh - var(--section-view-top) - var(--section-view-bottom));
    display:grid;
    align-content:center;
    scroll-snap-align:start;
    scroll-snap-stop:always;
    scroll-margin-top:0;
  }
  body[data-theme-page='partner-with-us'] .footer { scroll-snap-align:start; }
  body[data-theme-page='partner-with-us'] .partner-roles {
    display:grid;
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:88%;
    align-items:stretch;
    gap:16px;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
    padding:2px 2px 4px;
  }
  .partner-roles::-webkit-scrollbar { display:none; }
  .partner-roles .partner-role { min-width:0;scroll-snap-align:start;scroll-snap-stop:always; }
  body.responsive[data-theme-page='partner-with-us'] .partner-roles-section { padding-block:24px; }
  .partner-roles-section .section-intro h2 { font-size:28px;line-height:1.15; }
  .partner-roles-section .section-intro>p { margin-top:12px;font-size:13px; }
  .partner-roles .partner-role { padding:22px; }
  .partner-roles .partner-role h3 { font-size:24px; }
  .partner-roles .partner-role>p:not(.partner-role-no) { font-size:12px;line-height:1.75; }
  .partner-roles .partner-role ul { margin:16px 0 0; }
  .partner-roles .partner-role li { font-size:11.5px;padding-block:10px; }
  .partner-role-controls:not([hidden]) { display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:8px; }
  .partner-swipe-hint { font-size:11px;line-height:1.5; }
  .partner-role-controls>[role='group'] { display:flex; }
  .partner-role-dot { display:grid;place-items:center;width:44px;height:44px;padding:0;background:transparent;border:0;cursor:pointer; }
  .partner-role-dot span { width:7px;height:7px;border-radius:999px;background:#b8c0cb;transition:width .2s,background .2s; }
  .partner-role-dot[aria-current='true'] span { width:23px;background:var(--brand-red); }
}
@media(prefers-reduced-motion:reduce) { .partner-role-dot span { transition:none; } }

/* Both space types belong in the same mobile scroll view. Use small image
   previews alongside their headings, retaining the descriptions and examples. */
@media(max-width:900px) {
  body.responsive[data-theme-page='home'] #spaces { padding-block:24px; }
  body.responsive[data-theme-page='home'] #spaces .section-intro { margin-bottom:16px; }
  body.responsive[data-theme-page='home'] #spaces h2 { font-size:28px!important;line-height:1.12;text-wrap:balance; }
  body.responsive[data-theme-page='home'] #spaces .section-intro>p { margin-top:10px;font-size:12.5px;line-height:1.5; }
  body.responsive[data-theme-page='home'] #spaces .spaces-grid { grid-auto-rows:auto;gap:12px; }
  body.responsive[data-theme-page='home'] #spaces .space-panel {
    grid-template-columns:96px minmax(0,1fr);
    grid-template-rows:auto auto auto;
    gap:8px 14px;
    align-content:start;
    padding:12px;
  }
  body.responsive[data-theme-page='home'] #spaces .space-image {
    grid-column:1;
    grid-row:1;
    width:96px;
    height:66px;
    align-self:center;
    border:0!important;
    border-radius:6px;
  }
  body.responsive[data-theme-page='home'] #spaces .space-copy { display:contents; }
  body.responsive[data-theme-page='home'] #spaces .space-copy h3 { grid-column:2;grid-row:1;align-self:center;font-size:20px;line-height:1.15; }
  body.responsive[data-theme-page='home'] #spaces .space-copy p { grid-column:1/-1;grid-row:2;margin:0;max-width:none;font-size:13px;line-height:1.5; }
  body.responsive[data-theme-page='home'] #spaces .examples { grid-column:1/-1;grid-row:3;gap:6px;margin:0; }
  body.responsive[data-theme-page='home'] #spaces .examples li { font-size:10px;line-height:1.4;padding:4px 6px; }
  body.responsive[data-theme-page='home'] #spaces>.wrap>.home-section-cta { margin-top:12px; }
}
@media(max-width:900px) and (max-height:700px) {
  body.responsive[data-theme-page='home'] #spaces { padding-block:12px; }
  body.responsive[data-theme-page='home'] #spaces .section-intro { margin-bottom:12px; }
  body.responsive[data-theme-page='home'] #spaces h2 { font-size:26px!important; }
  body.responsive[data-theme-page='home'] #spaces .section-intro>p { font-size:12px;margin-top:8px; }
  body.responsive[data-theme-page='home'] #spaces .spaces-grid { gap:10px; }
  body.responsive[data-theme-page='home'] #spaces .space-panel { padding:10px;grid-template-columns:86px minmax(0,1fr);gap:8px 12px; }
  body.responsive[data-theme-page='home'] #spaces .space-image { width:86px;height:56px; }
  body.responsive[data-theme-page='home'] #spaces .space-copy h3 { font-size:19px; }
  body.responsive[data-theme-page='home'] #spaces .space-copy p { font-size:12px; }
  body.responsive[data-theme-page='home'] #spaces>.wrap>.home-section-cta { margin-top:8px; }
}
@media(max-width:340px) and (max-height:600px) {
  body.responsive[data-theme-page='home'] #spaces { padding-block:8px; }
  body.responsive[data-theme-page='home'] #spaces .section-intro { margin-bottom:8px; }
  body.responsive[data-theme-page='home'] #spaces h2 { font-size:22px!important;line-height:1.15; }
  body.responsive[data-theme-page='home'] #spaces .section-intro>p { line-height:1.4; }
  body.responsive[data-theme-page='home'] #spaces .spaces-grid { gap:8px; }
  body.responsive[data-theme-page='home'] #spaces .space-panel { padding:8px;grid-template-columns:76px minmax(0,1fr);column-gap:10px; }
  body.responsive[data-theme-page='home'] #spaces .space-image { width:76px;height:44px; }
  body.responsive[data-theme-page='home'] #spaces .space-copy h3 { font-size:18px; }
  body.responsive[data-theme-page='home'] #spaces .examples { gap:4px; }
  body.responsive[data-theme-page='home'] #spaces .examples li { padding:2px 3px; }
  body.responsive[data-theme-page='home'] #spaces>.wrap>.home-section-cta { margin-top:6px; }
}
