/* Homepage mobile layer: hero in normal flow, symmetric 16px gutters,
   24px section headings and sticky contact bar (menu panel lives in site-header.css).
   Loaded after home-clean-critical/deferred so it wins on equal specificity. */

.rk-sticky-cta {
  display: none;
}

@media (max-width: 767px) {
  body.rk-clean.rk-home-page {
    min-width: 320px;
  }

  /* ---------- Hero: normal flow instead of absolute 370px stage ---------- */
  body.rk-home-page .rk-hero {
    height: auto;
    min-height: 0;
  }

  /* Keep below-the-fold media inside the viewport before the deferred CSS arrives,
     otherwise the page is laid out wider and the sticky bar jumps (CLS) */
  body.rk-home-page .rk-media img,
  body.rk-home-page .rk-badge-card img {
    max-width: 100%;
  }

  body.rk-home-page .rk-badge-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  body.rk-home-page .rk-hero__stage {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 8px;
    row-gap: 0;
    width: 100%;
    height: auto;
    padding: 24px 16px 32px;
  }

  body.rk-home-page .rk-hero__stage > * {
    position: static;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    max-width: none;
  }

  body.rk-home-page .rk-hero__title {
    grid-column: 1 / -1;
    order: 1;
    margin: 0 auto;
    font-size: clamp(24px, 7vw, 28px);
    line-height: 1.25;
    text-align: center;
  }

  body.rk-home-page .rk-hero__lead {
    grid-column: 1 / -1;
    order: 2;
    margin: 12px auto 0;
    max-width: 36ch;
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
  }

  body.rk-home-page .rk-hero__ecosystem {
    grid-column: 1 / -1;
    order: 3;
    justify-self: center;
    width: min(100%, 270px);
    margin: 12px 0 8px;
  }

  body.rk-home-page .rk-hero__ecosystem picture,
  body.rk-home-page .rk-hero__ecosystem-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    aspect-ratio: 451 / 400;
    object-fit: contain;
    object-position: center;
  }

  body.rk-home-page .rk-hero__trust,
  body.rk-home-page .rk-hero__trust--1,
  body.rk-home-page .rk-hero__trust--2,
  body.rk-home-page .rk-hero__trust--3 {
    order: 4;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
  }

  body.rk-home-page .rk-hero__trust .rk-check-ico {
    width: 28px;
    height: 28px;
  }

  body.rk-home-page .rk-hero__cta {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
    min-height: 52px;
  }

  body.rk-home-page .rk-hero__cta--primary {
    order: 5;
    margin-top: 20px;
  }

  body.rk-home-page .rk-hero__cta--secondary {
    order: 6;
    margin-top: 10px;
  }

  body.rk-home-page .rk-metric-card,
  body.rk-home-page .rk-device {
    display: none;
  }

  /* ---------- Section headings: 24px ---------- */
  body.rk-home-page main .rk-h2,
  body.rk-home-page main .rk-h2--xl,
  body.rk-home-page #directions .rk-h2,
  body.rk-home-page #faq .rk-h2,
  body.rk-home-page #studio > .rk-container > .rk-h2:not(.rk-h2--spaced),
  body.rk-home-page #advantages .rk-h2,
  body.rk-home-page #academy > .rk-container > .rk-split .rk-h2,
  body.rk-home-page #r-builder > .rk-container > .rk-split .rk-h2,
  body.rk-home-page #about > .rk-container > .rk-h2:first-of-type,
  body.rk-home-page #partners .rk-h2,
  body.rk-home-page #contacts > .rk-container > .rk-h2 {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 16px;
    text-align: left;
  }

  body.rk-home-page .rk-h2--spaced {
    margin-top: 40px;
  }

  /* ---------- Sections: one rhythm ---------- */
  body.rk-home-page main .rk-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  body.rk-home-page main .rk-section--tight {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  /* ---------- Directions: 2-column grid instead of clipped carousel ---------- */
  body.rk-home-page .rk-directions {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  body.rk-home-page .rk-directions .rk-card {
    min-height: 0;
    padding: 12px 12px 52px;
  }

  body.rk-home-page .rk-directions .rk-card > p {
    margin: 0;
  }

  body.rk-home-page .rk-directions .rk-card__more {
    right: 12px;
    bottom: 12px;
  }

  /* ---------- Buttons: full width, one column ---------- */
  body.rk-home-page main .rk-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.rk-home-page main .rk-actions .rk-btn {
    width: 100%;
    justify-content: center;
  }

  /* "Стать партнёром" was white text on a white button */
  body.rk-home-page .rk-btn--ghost-on-purple {
    background: transparent;
  }

  /* Agency illustration overlapped the list */
  body.rk-home-page .rk-partners-agency__illus {
    position: static;
    display: block;
    width: 110px;
    margin: 12px auto 0;
  }

  /* ---------- Shared footer: same 16px gutters as the page ---------- */
  body.rk-home-page .rk-site-footer .rk-footer__shell {
    width: calc(100% - 32px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  body.rk-home-page .rk-site-footer .rk-footer-cta__bg--mob {
    left: 16px !important;
    width: calc(100% - 32px) !important;
    border-radius: 12px;
  }

  body.rk-home-page .rk-site-footer .rk-footer-cta__text {
    left: 32px !important;
    width: calc(100% - 64px) !important;
    max-width: none !important;
  }

  body.rk-home-page .rk-site-footer .rk-footer-cta__icon--mob {
    left: 32px !important;
  }

  body.rk-home-page .rk-site-footer .rk-footer-cta__btn {
    left: 82px !important;
    right: 32px !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* ---------- Sticky contact bar (same as /web-studiya/) ---------- */
  body.rk-home-page .rk-sticky-cta {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--rk-border);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  body.rk-home-page .rk-sticky-cta__btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: var(--rk-font-head);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    color: #fff;
  }

  body.rk-home-page .rk-sticky-cta__btn--call {
    background: linear-gradient(270deg, rgb(223, 98, 226) 9%, rgb(106, 92, 234) 90%);
  }

  body.rk-home-page .rk-sticky-cta__btn--wa {
    background: #0e7a4b;
  }

  body.rk-home-page .rk-sticky-cta__btn:hover {
    color: #fff;
    opacity: 0.94;
  }

  body.rk-home-page {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.rk-home-page .rk-scroll-top,
  body.rk-home-page .rk-soc-widget {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  body.rk-home-page.rk-menu-open .rk-sticky-cta {
    display: none;
  }
}
