/* sh-home-fixed-1024: stop cqw/1920 proportional shrink of hero + steps
   Root cause in home.css:
     .sh-home__stage { width:1920px; transform:scale(calc(100cqw / 1920px)); }
     .sh-home__sizer { height:calc(H * 100cqw / 1920); }
   Loaded after home.css and landing-v2.css.

   min-width 1366px: 1920 design sizes in px, only side gutters shrink.
   1024-1365: pack to available width, typography stays at design px sizes.
   max-width 1023: unchanged tablet/mobile (v10 at 768).

   sh-man-no-overlap: at all widths >=1024 the armchair photo stays in the
   left column and shrinks to the free space left of the process column
   (24px gap). It must never cover the steps.

   sh-girl-wave-clip: at >=1024 the hero girl is ~+10% and 35px higher than
   deploy7; an opaque wave cap on the hero stage (same SVG path as block 2,
   page-aligned) crops the desk along the wave. Gray below the wave is
   fully opaque. Text/buttons stay put. <1024 unchanged.
*/

/* ---- 1366+: fixed 1920 sizes, shrinking side margins ---- */
@media (min-width: 1366px) {
  .sh-home--hero,
  .sh-home--steps {
    overflow-x: clip;
    overflow-y: visible;
    max-width: 100%;
  }

  .sh-home__stage {
    transform: none;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
  }

  .sh-home--hero .sh-home__sizer,
  .sh-home--hero .sh-home__stage {
    height: 604px;
    overflow: visible;
  }

  .sh-home--steps .sh-home__sizer,
  .sh-home--steps .sh-home__stage {
    height: 841px;
  }

  .lv2 .sh-home--hero .sh-home__sizer,
  .lv2 .sh-home--hero .sh-home__stage {
    height: 640px;
  }

  .sh-hero {
    left: calc(390px + (100% - 1920px) / 2);
  }

  .sh-photo-girl {
    left: calc(860px + (100% - 1920px) / 2);
  }

  /* Design process starts at 975px, man at 170px. 24px gap => width 781px. */
  .sh-home--steps .sh-photo-man,
  .lv2 .sh-home--steps .sh-photo-man {
    left: calc(170px + max(-170px, (100% - 1920px) / 2));
    top: 50%;
    bottom: auto;
    width: 781px;
    max-width: 781px;
    height: auto;
    transform: translateY(-50%);
    overflow: hidden;
  }

  .sh-home--steps .sh-photo-man img,
  .lv2 .sh-home--steps .sh-photo-man img {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
  }

  .sh-process {
    left: calc(975px + max(-170px, (100% - 1920px) / 2));
  }
}

/* ---- 1024-1365: fill available width, readable px sizes, photos visible ---- */
@media (min-width: 1024px) and (max-width: 1365px) {
  .sh-home--hero,
  .sh-home--steps {
    overflow-x: clip;
    overflow-y: visible;
    max-width: 100%;
  }

  .sh-home--hero .sh-home__sizer,
  .sh-home--steps .sh-home__sizer,
  .lv2 .sh-home--hero .sh-home__sizer,
  .lv2 .sh-home--steps .sh-home__sizer {
    height: auto;
    overflow: visible;
  }

  .sh-home--hero .sh-home__stage,
  .lv2 .sh-home--hero .sh-home__stage {
    --sh-text-w: min(458px, calc(50vw - 12px));
    --sh-girl-w: min(769px, calc(100vw - 72px - var(--sh-text-w)));
    transform: none;
    width: 100%;
    height: auto;
    min-height: calc(28px + var(--sh-girl-w) * 516 / 769);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 24px 0;
    position: relative;
  }

  .lv2 .sh-home--hero .sh-home__stage {
    --sh-text-w: min(500px, calc(50vw - 12px));
  }

  .sh-home--hero .sh-hero,
  .lv2 .sh-home--hero .sh-hero {
    position: relative;
    left: auto;
    top: auto;
    width: 458px;
    max-width: calc(50% - 12px);
    flex: 0 1 458px;
    height: auto;
    gap: 24px;
    margin: 0;
    align-items: flex-start;
    text-align: left;
    z-index: 2;
  }

  .lv2 .sh-home--hero .sh-hero {
    width: 500px;
    flex-basis: 500px;
  }

  .sh-home--hero .sh-hero__title,
  .lv2 .sh-home--hero .sh-hero__title {
    height: auto;
    font-size: 38px;
    line-height: 1.2;
  }

  .sh-home--hero .sh-hero__lead,
  .lv2 .sh-home--hero .sh-hero__lead {
    height: auto;
    font-size: 20px;
    line-height: 1.3;
  }

  .sh-home--hero .sh-hero__note,
  .lv2 .sh-home--hero .sh-hero__note {
    font-size: 16px;
    line-height: 1.2;
  }

  .sh-home--hero .sh-hero__buttons,
  .lv2 .sh-home--hero .sh-hero__buttons {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
  }

  .sh-home--hero .sh-btn,
  .lv2 .sh-home--hero .sh-btn {
    height: 50px;
    min-height: 50px;
    padding: 10px 20px 10px 10px;
    font-size: 16px;
  }

  .sh-home--hero .sh-photo-girl,
  .lv2 .sh-home--hero .sh-photo-girl {
    position: relative;
    left: auto;
    top: auto;
    display: block;
    flex: 0 0 var(--sh-girl-w, 769px);
    width: var(--sh-girl-w, 769px);
    max-width: 769px;
    height: auto;
    min-width: 0;
    overflow: visible;
    margin-left: auto;
    margin-bottom: 0;
    z-index: 1;
    background: none;
  }

  .sh-home--hero .sh-photo-girl img,
  .lv2 .sh-home--hero .sh-photo-girl img {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center bottom;
  }

  /* sh-man-no-overlap: two columns, man shrinks, 24px gap, vertically centered */
  .sh-home--steps .sh-home__stage,
  .lv2 .sh-home--steps .sh-home__stage {
    transform: none;
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 48px 24px 32px;
    position: relative;
  }

  .sh-home--steps .sh-photo-man,
  .lv2 .sh-home--steps .sh-photo-man {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    left: auto;
    top: auto;
    bottom: auto;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: 944px;
    height: auto;
    z-index: 1;
    overflow: hidden;
    order: 0;
  }

  .sh-home--steps .sh-photo-man img,
  .lv2 .sh-home--steps .sh-photo-man img {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center center;
  }

  .sh-home--steps .sh-process,
  .lv2 .sh-home--steps .sh-process {
    position: relative;
    left: auto;
    top: auto;
    margin: 0;
    flex: 0 1 auto;
    width: 560px;
    max-width: calc(50% - 12px);
    height: auto;
    gap: 40px;
    z-index: 2;
    order: 1;
  }

  .sh-home--steps .sh-process__title,
  .lv2 .sh-home--steps .sh-process__title {
    height: auto;
    font-size: 30px;
    line-height: 1.25;
    white-space: normal;
  }

  .sh-home--steps .sh-process__subtitle,
  .lv2 .sh-home--steps .sh-process__subtitle {
    height: auto;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
  }

  .sh-home--steps .sh-step,
  .sh-home--steps .sh-step:nth-child(odd),
  .lv2 .sh-home--steps .sh-step,
  .lv2 .sh-home--steps .sh-step:nth-child(odd) {
    width: calc(50% - 15px);
  }

  .sh-home--steps .sh-step__title,
  .lv2 .sh-home--steps .sh-step__title {
    font-size: 14px;
    line-height: 1.3;
  }

  .sh-home--steps .sh-step__text,
  .lv2 .sh-home--steps .sh-step__text {
    font-size: 14px;
    line-height: 1.4;
  }
}

/* ---- sh-girl-wave-crop (k12) ----
   The girl PNG is pre-cropped along the 1920-wide design wave
   (spline of wave-top, sampled at x=860..1629, y starting at 412px
   in the 769x516 box). The CSS mask on .sh-photo-girl and the
   opaque .sh-home__stage::after cap are gone — those caused the
   white 412px seam across the desk and the untextured gray patch
   left of the desk.

   The steps block uses the same gray recipe as landing blocks 4/6/8
   (#f3f6f7 + 40% white veil + bg2 cover) with SVG wave edges.
   The TOP wave is a 3840-wide SVG whose centre 1920px is the design
   path (not stretched to 100vw), positioned so x=860 in that path
   lines up with the girl. --sh-wave-scale tracks the girl width
   (1 at >=1366, girl-w/769 in the 1024-1365 packed layout) so the
   baked edge and the background wave stay locked.

   <1024: the girl and man are hidden (home.css); pull is 0; the
   wave is the 1920 design path centered on the viewport.
*/

.sh-home {
  --sh-wave-h: 80px;
  --sh-wave-scale: 1;
  --sh-wave-pull: 0px;
  --sh-girl-w: 769px;
  --sh-girl-left: calc(860px + (100vw - 1920px) / 2);
  --sh-wave-canvas-left: calc(var(--sh-girl-left) - 860px * var(--sh-wave-scale));
  --sh-wave-ext-left: calc(var(--sh-wave-canvas-left) - 960px * var(--sh-wave-scale));
  --sh-wave-ext-x: calc(3840px * var(--sh-wave-scale));
  --sh-wave-ext-y: calc(80px * var(--sh-wave-scale));
  --sh-wave-top: url(/image/landing/wave-top-wide.svg);
  --sh-wave-bot: url(/image/landing/wave-bot-wide.svg);
}

/* Steps: same lighter gray as blocks 4/6/8, stable (non-stretched) wave. */
.sh-home--steps {
  position: relative;
  z-index: 2;
  margin-top: calc(0px - var(--sh-wave-pull));
  padding-top: var(--sh-wave-pull);
  overflow: visible;
  background-color: transparent;
  background-image: none;
}

.sh-home--steps > * {
  position: relative;
  z-index: 4;
}

.sh-home--steps::before,
.lv2 .sh-home--steps::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #f3f6f7 !important;
  background-image: linear-gradient(rgba(255,255,255,.4), rgba(255,255,255,.4)), url(/image/landing/bg2.webp) !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: cover !important;
  /* px/calc positions only — a % + 100vw size shifts the wave (k9). */
  -webkit-mask-image: var(--sh-wave-top), linear-gradient(#000,#000), var(--sh-wave-bot) !important;
  mask-image: var(--sh-wave-top), linear-gradient(#000,#000), var(--sh-wave-bot) !important;
  /* Middle layer is centered: a 100%-140s tall slab leaves 70s at each
     end, overlapping the 80s wave by 10s. Do NOT position it at 0 0 —
     that paints the area above the curve and flattens the top wave. */
  -webkit-mask-position: var(--sh-wave-ext-left) top, center, var(--sh-wave-ext-left) bottom !important;
  mask-position: var(--sh-wave-ext-left) top, center, var(--sh-wave-ext-left) bottom !important;
  -webkit-mask-size: var(--sh-wave-ext-x) var(--sh-wave-ext-y), 100% calc(100% - 2 * var(--sh-wave-ext-y) + 20px * var(--sh-wave-scale)), var(--sh-wave-ext-x) var(--sh-wave-ext-y) !important;
  mask-size: var(--sh-wave-ext-x) var(--sh-wave-ext-y), 100% calc(100% - 2 * var(--sh-wave-ext-y) + 20px * var(--sh-wave-scale)), var(--sh-wave-ext-x) var(--sh-wave-ext-y) !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-composite: source-over !important;
  mask-composite: add !important;
  -webkit-mask-source-type: alpha !important;
  mask-mode: alpha !important;
}

/* Desktop: girl is visible; crop is in the PNG. No CSS mask, no cap. */
@media (min-width: 1024px) {
  .sh-home {
    --sh-wave-pull: 104px;
  }

  .sh-home--hero {
    position: relative;
    z-index: 1;
    overflow: visible;
    overflow-x: clip;
    overflow-y: visible;
  }

  .sh-home--hero .sh-home__scaler,
  .sh-home--hero .sh-home__sizer,
  .sh-home--hero .sh-home__stage {
    overflow: visible;
    background: transparent;
  }

  .sh-home--hero .sh-home__stage {
    position: relative;
  }

  .sh-home--hero .sh-photo-girl,
  .lv2 .sh-home--hero .sh-photo-girl {
    overflow: visible !important;
    background: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .sh-home--hero .sh-photo-girl img,
  .lv2 .sh-home--hero .sh-photo-girl img {
    display: block;
    background: transparent !important;
    border: 0;
    outline: 0;
    box-shadow: none;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .sh-home--hero .sh-hero,
  .lv2 .sh-home--hero .sh-hero {
    position: relative;
    z-index: 4;
  }

  /* Kill the k9/k11 cap if a cached rule or older CSS leftover exists. */
  .sh-home--hero .sh-home__stage::after,
  .lv2 .sh-home--hero .sh-home__stage::after {
    content: none !important;
    display: none !important;
  }
}

/* 1024-1365 packed: scale the 1920 wave with the girl width so the
   baked edge still matches. Girl is right-aligned (margin-left:auto). */
@media (min-width: 1024px) and (max-width: 1365px) {
  .sh-home {
    --sh-text-w: min(458px, calc(50vw - 12px));
    --sh-girl-w: min(769px, calc(100vw - 72px - var(--sh-text-w)));
    --sh-wave-scale: calc(var(--sh-girl-w) / 769px);
    --sh-girl-left: calc(100vw - 24px - var(--sh-girl-w));
    --sh-wave-pull: calc(152px * var(--sh-wave-scale));
  }

  .lv2,
  .lv2 .sh-home {
    --sh-text-w: min(500px, calc(50vw - 12px));
    --sh-wave-pull: calc(158px * var(--sh-wave-scale));
  }

  /* pad-bottom = pull - 104*scale, so steps_top = girl_top + 412*scale.
     Must include .lv2 — the packed shorthand padding: 28px 24px 0 is
     on .lv2 .sh-home--hero .sh-home__stage (higher specificity). */
  .sh-home--hero .sh-home__stage,
  .lv2 .sh-home--hero .sh-home__stage {
    padding-bottom: calc(var(--sh-wave-pull) - 104px * var(--sh-wave-scale));
  }
}

/* 1366+: 1920 design sizes, scale 1, only side gutters shrink. */
@media (min-width: 1366px) {
  .sh-home {
    --sh-wave-scale: 1;
    --sh-wave-pull: 152px;
    --sh-girl-w: 769px;
    --sh-girl-left: calc(860px + (100vw - 1920px) / 2);
  }

  .lv2,
  .lv2 .sh-home {
    --sh-wave-pull: 158px;
  }

  .sh-home--hero .sh-photo-girl {
    top: 40px;
    width: 769px;
    height: 516px;
    overflow: visible;
    background: none;
  }

  .sh-home--hero .sh-photo-girl img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
  }

  .lv2 .sh-home--hero .sh-photo-girl {
    top: 70px;
    width: 769px;
    height: 516px;
  }
}
