/* ==========================================================
   RuGo Full Website v011 — Desktop Contact Flow Foundation

   DEF18 structural correction:
   - preserve the approved v109/v010 one-viewport CONTACT geometry when the
     active intake content fits;
   - allow the CONTACT main row to grow with Steps 2–5 / photo content;
   - keep the footer in normal flow after the expanded main content;
   - release document scrolling only while CONTACT is the active spatial level;
   - preserve every non-CONTACT spatial row as a locked 100svh composition.

   DEF19 boundary:
   This file intentionally does not introduce a global scale transform or
   per-breakpoint redesign. The post-correction viewport matrix remains the
   authority for any additional geometry tuning.
   ========================================================== */

body.boot-complete.spatial-contact-flow{
  height:auto!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}

body.spatial-contact-flow .spatial-experience{
  height:auto!important;
  min-height:100svh;
  overflow:visible!important;
}

/* The first three spatial rows retain their exact 100svh height. The track's
   negative bottom margin removes those offscreen rows from document-flow
   height after the -300svh transform brings CONTACT to the viewport origin. */
body.spatial-contact-flow .spatial-vertical-track{
  height:auto!important;
  min-height:0!important;
  margin-bottom:-300svh;
}

body.spatial-contact-flow .spatial-row[data-spatial-screen="contact"]{
  flex:0 0 auto!important;
  width:100%;
  height:auto!important;
  min-height:100svh!important;
  overflow:visible!important;
}

body.spatial-contact-flow .contact-screen-v086{
  min-height:100svh!important;
  overflow:visible!important;
}

body.spatial-contact-flow .contact-v086{
  /* Original v086 used absolute inset:7vh 0 0, leaving exactly 93svh of
     composition space. Relative flow + 7vh top padding preserves that same
     initial geometry while allowing the grid to become taller. */
  --contact-v011-gap:clamp(18px,2.2vh,28px);
  --contact-v011-main-min:max(
    0px,
    calc(
      93svh
      - max(220px,25.5svh)
      - max(110px,12.5svh)
      - var(--contact-v011-gap)
      - var(--contact-v011-gap)
    )
  );

  position:relative!important;
  inset:auto!important;
  box-sizing:border-box;
  width:100%;
  min-height:100svh;
  padding-top:7vh;
  grid-template-rows:
    minmax(220px,25.5vh)
    minmax(var(--contact-v011-main-min),auto)
    minmax(110px,12.5vh);
  row-gap:var(--contact-v011-gap);
}

/* Keep the approved left editorial composition at its canonical main-band
   height even when the right intake continuation becomes taller. */
body.spatial-contact-flow .contact-v086__editorial{
  align-self:start;
  box-sizing:border-box;
  width:100%;
  height:var(--contact-v011-main-min);
  min-height:var(--contact-v011-main-min);
}

body.spatial-contact-flow .contact-v086__form,
body.spatial-contact-flow .rugo-intake-continuation{
  align-self:start;
  min-height:var(--contact-v011-main-min);
}

/* Footer is a real following grid row; never overlay the expanded intake. */
body.spatial-contact-flow .contact-v086__footer{
  position:relative;
  z-index:1;
}

@media(max-width:860px){
  /* Mobile/tablet final design is a later gate. Do not force the desktop flow
     architecture onto the existing mobile fallback in this revision. */
  body.boot-complete.spatial-contact-flow{
    overflow:hidden!important;
    height:100svh!important;
    max-height:100svh!important;
  }
  body.spatial-contact-flow .spatial-experience{
    height:100svh!important;
    min-height:0;
    overflow:hidden!important;
  }
  body.spatial-contact-flow .spatial-vertical-track{
    height:400svh!important;
    margin-bottom:0;
  }
  body.spatial-contact-flow .spatial-row[data-spatial-screen="contact"]{
    flex:0 0 100svh!important;
    height:100svh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.spatial-contact-flow .contact-screen-v086{
    min-height:100svh!important;
    overflow:hidden!important;
  }
  body.spatial-contact-flow .contact-v086{
    position:absolute!important;
    inset:7vh 0 0!important;
    width:auto;
    min-height:0;
    padding-top:0;
    grid-template-rows:
      minmax(220px,25.5vh)
      minmax(0,1fr)
      minmax(110px,12.5vh);
  }
  body.spatial-contact-flow .contact-v086__editorial{
    align-self:stretch;
    height:auto;
    min-height:0;
  }
  body.spatial-contact-flow .contact-v086__form,
  body.spatial-contact-flow .rugo-intake-continuation{
    align-self:stretch;
    min-height:0;
  }
}
