/* =========================================================
   WHY HAVE A WEBSITE — FIXED MOBILE COMPOSITION
   Final mobile override. Desktop remains unchanged.
   ========================================================= */

@media (max-width: 700px) and (orientation: portrait) {
  html,
  body.whywebsite-page {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body.whywebsite-page .whywebsite-mobile-story {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  body.whywebsite-page .whywebsite-mobile-inner {
    width: 100%;
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    min-height: 0;
    overflow: hidden;
    padding:
      max(84px, calc(env(safe-area-inset-top) + 76px))
      max(22px, calc(env(safe-area-inset-right) + 18px))
      max(10px, calc(env(safe-area-inset-bottom) + 6px))
      max(22px, calc(env(safe-area-inset-left) + 18px));
  }

  body.whywebsite-page .why-foundry-wordmark {
    top: max(27px, calc(env(safe-area-inset-top) + 19px)) !important;
    left: max(29px, calc(env(safe-area-inset-left) + 23px)) !important;
  }

  body.whywebsite-page .foundry-global-nav {
    top: max(19px, calc(env(safe-area-inset-top) + 12px)) !important;
    right: max(17px, calc(env(safe-area-inset-right) + 12px)) !important;
  }

  body.whywebsite-page .whywebsite-mobile-story h1 {
    font-size: clamp(2.65rem, 11vw, 3.65rem);
    line-height: .9;
  }

  body.whywebsite-page .whywebsite-copper-rule {
    width: 54px;
    height: 2px;
    margin: 14px 0 13px;
  }

  body.whywebsite-page .whywebsite-mobile-intro {
    margin: 0 0 15px;
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    line-height: 1.12;
  }

  body.whywebsite-page .whywebsite-steps {
    gap: clamp(10px, 1.5dvh, 14px);
    margin: 0 0 14px;
  }

  body.whywebsite-page .whywebsite-steps li {
    grid-template-columns: clamp(38px, 10.4vw, 44px) 1fr;
    gap: clamp(14px, 3.8vw, 18px);
    min-height: clamp(38px, 10.4vw, 44px);
  }

  body.whywebsite-page .whywebsite-steps span {
    width: clamp(38px, 10.4vw, 44px);
    height: clamp(38px, 10.4vw, 44px);
    font-size: clamp(1rem, 4vw, 1.12rem);
  }

  body.whywebsite-page .whywebsite-steps::before {
    top: 20px;
    bottom: 20px;
    left: clamp(18px, 5vw, 21px);
  }

  body.whywebsite-page .whywebsite-steps p {
    font-size: clamp(1.14rem, 4.65vw, 1.38rem);
    line-height: 1.04;
  }

  body.whywebsite-page .whywebsite-mobile-value {
    margin: 0 0 13px;
    font-size: clamp(.88rem, 3.55vw, 1rem);
    line-height: 1.28;
  }

  body.whywebsite-page .whywebsite-mobile-pill {
    grid-template-columns: 46px 1fr;
    gap: 13px;
    min-height: 72px;
    padding: 10px 15px 10px 11px;
    border-width: 1px;
    border-radius: 13px;
  }

  body.whywebsite-page .whywebsite-mobile-pill img {
    width: 44px;
    height: 44px;
  }

  body.whywebsite-page .whywebsite-mobile-pill p {
    font-size: clamp(.9rem, 3.6vw, 1.06rem);
    line-height: 1.15;
  }
}

@media (max-width: 700px) and (max-height: 680px) and (orientation: portrait) {
  body.whywebsite-page .whywebsite-mobile-inner {
    padding-top: max(80px, calc(env(safe-area-inset-top) + 72px));
  }

  body.whywebsite-page .whywebsite-mobile-story h1 {
    font-size: clamp(2.4rem, 10.2vw, 3.2rem);
  }

  body.whywebsite-page .whywebsite-mobile-intro {
    font-size: clamp(1.1rem, 4.45vw, 1.35rem);
  }

  body.whywebsite-page .whywebsite-steps {
    gap: 7px;
    margin-bottom: 10px;
  }

  body.whywebsite-page .whywebsite-steps li {
    grid-template-columns: 36px 1fr;
    gap: 13px;
    min-height: 36px;
  }

  body.whywebsite-page .whywebsite-steps span {
    width: 36px;
    height: 36px;
    font-size: .94rem;
  }

  body.whywebsite-page .whywebsite-steps::before {
    top: 18px;
    bottom: 18px;
    left: 17px;
  }

  body.whywebsite-page .whywebsite-steps p {
    font-size: clamp(1.02rem, 4.2vw, 1.2rem);
  }

  body.whywebsite-page .whywebsite-mobile-value {
    font-size: .8rem;
    margin-bottom: 9px;
  }

  body.whywebsite-page .whywebsite-mobile-pill {
    min-height: 62px;
    grid-template-columns: 39px 1fr;
    padding: 8px 12px 8px 9px;
  }

  body.whywebsite-page .whywebsite-mobile-pill img {
    width: 38px;
    height: 38px;
  }

  body.whywebsite-page .whywebsite-mobile-pill p {
    font-size: .86rem;
  }
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 700px) {
  html,
  body.whywebsite-page {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body.whywebsite-page .whywebsite-mobile-story {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
  }

  body.whywebsite-page .whywebsite-mobile-inner {
    width: 100%;
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    min-height: 0;
    overflow: hidden;
    padding:
      max(52px, calc(env(safe-area-inset-top) + 45px))
      max(20px, calc(env(safe-area-inset-right) + 16px))
      max(9px, calc(env(safe-area-inset-bottom) + 6px))
      max(20px, calc(env(safe-area-inset-left) + 16px));
    display: grid;
    grid-template-columns: minmax(210px, .9fr) minmax(0, 1.55fr);
    grid-template-rows: auto auto 1fr auto;
    column-gap: clamp(28px, 4.5vw, 58px);
    row-gap: 0;
    align-items: start;
  }

  body.whywebsite-page .why-foundry-wordmark {
    top: max(18px, calc(env(safe-area-inset-top) + 11px)) !important;
    left: max(23px, calc(env(safe-area-inset-left) + 18px)) !important;
  }

  body.whywebsite-page .foundry-global-nav {
    top: max(10px, calc(env(safe-area-inset-top) + 5px)) !important;
    right: max(14px, calc(env(safe-area-inset-right) + 10px)) !important;
  }

  body.whywebsite-page .whywebsite-mobile-story h1 {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    font-size: clamp(2.45rem, 5.6vw, 3.4rem);
    line-height: .88;
  }

  body.whywebsite-page .whywebsite-copper-rule {
    grid-column: 1;
    grid-row: 2;
    width: 48px;
    margin: 8px 0;
  }

  body.whywebsite-page .whywebsite-mobile-intro {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
    font-size: clamp(1rem, 2.25vw, 1.25rem);
    line-height: 1.1;
  }

  body.whywebsite-page .whywebsite-steps {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(7px, 1.8dvh, 12px) clamp(18px, 2.8vw, 34px);
    margin: 0;
  }

  body.whywebsite-page .whywebsite-steps::before {
    display: none;
  }

  body.whywebsite-page .whywebsite-steps li {
    grid-template-columns: 32px 1fr;
    gap: 10px;
    min-height: 32px;
  }

  body.whywebsite-page .whywebsite-steps span {
    width: 32px;
    height: 32px;
    font-size: .85rem;
  }

  body.whywebsite-page .whywebsite-steps p {
    font-size: clamp(.84rem, 1.75vw, 1.05rem);
    line-height: 1.03;
  }

  body.whywebsite-page .whywebsite-mobile-value {
    grid-column: 1;
    grid-row: 4;
    align-self: end;
    margin: 0;
    padding-right: 10px;
    font-size: clamp(.67rem, 1.35vw, .82rem);
    line-height: 1.25;
  }

  body.whywebsite-page .whywebsite-mobile-pill {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    min-height: 48px;
    grid-template-columns: 34px 1fr;
    gap: 9px;
    padding: 5px 11px 5px 8px;
    border-width: 1px;
    border-radius: 12px;
  }

  body.whywebsite-page .whywebsite-mobile-pill img {
    width: 32px;
    height: 32px;
  }

  body.whywebsite-page .whywebsite-mobile-pill p {
    font-size: clamp(.72rem, 1.45vw, .88rem);
    line-height: 1.12;
  }
}
