@media (max-width: 1023px) {
  :root {
    --container-padding: 40px;
    --grid-gap: 20px;
  }
}

@media (max-width: 767px) {
  :root {
    --container-padding: 20px;
    --grid-gap: 16px;
    --header-height: 56px;
  }

  .col-6,
  .col-7,
  .col-5,
  .col-4 {
    grid-column: span 12;
  }

  /* Header */
  .site-header__inner {
    height: var(--header-height);
  }

  .header-nav-btn {
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .site-header__logo {
    top: 32px;
    padding: 14px 20px 18px;
  }

  .site-header__logo img {
    height: 14px;
  }

  /* Mobile navigation: full-height overlay under the header that scrolls
     if the links don't fit (e.g. landscape / short screens), instead of a
     fixed 70vh panel that clipped links and left a dead backdrop strip. */
  .site-nav__panel {
    height: calc(100dvh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    align-items: flex-start;
    padding-top: 36px;
    padding-bottom: 36px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav__list {
    width: 100%;
    margin: auto 0;
    gap: 18px;
  }

  .site-nav__backdrop {
    display: none;
  }

  /* Hero */
  .hero {
    align-items: flex-start;
    min-height: 100svh;
    padding-top: 120px;
    padding-bottom: 48px;
  }

  .hero__bg img {
    width: 115%;
    max-width: none;
    object-position: 70% top;
    transform: translateX(-8%);
  }

  .hero__overlay {
    background: linear-gradient(
      to bottom,
      rgba(34, 30, 26, 0.72) 0%,
      rgba(34, 30, 26, 0.35) 38%,
      rgba(34, 30, 26, 0.1) 62%,
      rgba(34, 30, 26, 0.45) 100%
    );
  }

  .hero__title {
    margin-bottom: 24px;
    font-size: 28px;
    letter-spacing: 0.02em;
  }

  .hero .btn {
    width: 100%;
  }

  /* About */
  .about__content {
    padding-right: 0;
  }

  .about__grid {
    gap: 32px;
  }

  .about__title {
    margin-bottom: 24px;
    font-size: 28px;
  }

  .about__text {
    margin-bottom: 32px;
  }

  .about__text p {
    font-size: 15px;
  }

  .about__features {
    grid-template-columns: 1fr;
    margin-bottom: 32px;
  }

  .about__feature,
  .about__feature:nth-child(even) {
    padding: 14px 0;
  }

  .about__feature-text {
    font-size: 15px;
  }

  .about .btn {
    width: 100%;
  }

  /* Infrastructure */
  .infrastructure__grid {
    gap: 32px;
  }

  .infrastructure__title {
    margin-bottom: 24px;
    font-size: 28px;
  }

  .infrastructure__text {
    margin-bottom: 20px;
  }

  .infrastructure__text p {
    font-size: 15px;
  }

  .infrastructure__list {
    gap: 10px;
  }

  .infrastructure__list li {
    font-size: 13px;
  }

  .col-10 {
    grid-column: span 12;
  }

  .infrastructure-gallery {
    margin-top: 48px;
  }

  .infrastructure-gallery__viewport {
    height: 100vh;
    height: 100svh;
  }

  .infrastructure-gallery__controls {
    bottom: 24px;
    left: var(--container-padding);
    gap: 12px;
  }

  .infrastructure-gallery__counter {
    font-size: 14px;
  }

  /* Formats */
  .formats__title {
    margin-bottom: 32px;
    font-size: 28px;
  }

  .formats__grid {
    gap: 32px;
  }

  .formats__visual img {
    min-height: 320px;
  }

  .formats__cards {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .formats__card {
    min-height: 140px;
    padding: 20px;
    gap: 20px;
  }

  .formats__card-icon {
    font-size: 28px;
  }

  .formats__card-text {
    font-size: 15px;
  }

  /* Plans */
  .plans__title {
    margin-bottom: 32px;
    font-size: 28px;
  }

  .plans__tabs {
    margin-bottom: 32px;
  }

  .plans__tab {
    padding: 12px 20px;
    font-size: 15px;
  }

  .plans__grid {
    gap: 32px;
  }

  .plans__content {
    gap: 24px;
  }

  .plans__subtitle {
    font-size: 24px;
  }

  .plans__text {
    font-size: 15px;
  }

  .plans__visual {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
    padding: 24px;
  }

  .plans__visual-inner {
    inset: 24px;
  }

  .plans .btn {
    width: 100%;
  }

  /* Finishing */
  .finishing__title {
    margin-bottom: 32px;
    font-size: 28px;
  }

  .finishing__grid {
    gap: 32px;
  }

  .finishing__card {
    gap: 20px;
  }

  .finishing__card-head {
    gap: 16px;
  }

  .finishing__card-num {
    font-size: 40px;
  }

  .finishing__card-body {
    padding-top: 4px;
  }

  .finishing__card-title {
    font-size: 16px;
  }

  .finishing__card-text {
    font-size: 13px;
  }

  /* Offers */
  .offers__title {
    margin-bottom: 32px;
    font-size: 28px;
  }

  .offers__grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }

  .offers__card {
    min-height: 240px;
    padding: 20px;
  }

  .offers__card-icon {
    font-size: 48px;
  }

  .offers__card-text {
    font-size: 15px;
  }

  .offers__action .btn {
    width: 100%;
  }

  /* Developer */
  .developer__grid {
    gap: 32px;
  }

  .developer__intro {
    min-height: auto;
    gap: 32px;
  }

  .developer__stat-num {
    font-size: 72px;
  }

  .developer__stat-label {
    font-size: 28px;
  }

  .developer__cards {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .developer__card {
    min-height: 140px;
    padding: 20px;
    gap: 20px;
  }

  .developer__card-value {
    font-size: 24px;
  }

  .developer__card-value--sm {
    font-size: 20px;
  }

  .developer__card-text {
    font-size: 15px;
  }

  /* Location */
  .location__grid {
    gap: 32px;
  }

  .location__content {
    order: 1;
    padding-left: 0;
  }

  .location__gallery {
    order: 2;
  }

  .location__title {
    margin-bottom: 24px;
    font-size: 28px;
  }

  .location__subtitle {
    margin-bottom: 16px;
    font-size: 30px;
  }

  .location__list {
    gap: 8px;
    margin-bottom: 32px;
  }

  .location__list li {
    font-size: 15px;
  }

  .location-map {
    margin-top: 48px;
  }

  .location-map__canvas {
    height: 380px;
  }

  .location-map__marker--main {
    width: 48px;
    height: 54px;
  }

  .location-map__pin {
    width: 48px;
    height: 54px;
  }

  .location-map__logo {
    left: calc(100% + 8px);
    top: 8px;
    width: 120px;
    height: 28px;
  }

  .location-map__marker--poi {
    width: 32px;
    height: 32px;
  }

  .location-map__marker--poi .material-symbols-outlined {
    font-size: 18px;
  }

  /* CTA */
  .cta__banner {
    min-height: 520px;
  }

  .cta__content {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    padding: 40px 24px 300px;
  }

  .cta__title {
    font-size: 28px;
  }

  .cta__text {
    margin-bottom: 24px;
    font-size: 13px;
  }

  .cta__visual {
    left: 50%;
    right: auto;
    width: 95%;
    height: 52%;
    transform: translateX(-50%);
  }

  .cta__visual img {
    left: 50%;
    right: auto;
    bottom: -14%;
    width: 118%;
    max-height: 135%;
    object-position: center bottom;
    transform: translateX(-50%);
  }

  .cta__btn {
    width: 100%;
  }

  /* Footer */
  .site-footer__aside {
    gap: 32px;
    align-items: flex-start;
  }

  .site-footer__phone {
    margin-bottom: 24px;
    font-size: 28px;
  }

  .site-footer__year {
    align-self: flex-end;
  }

  .site-footer__links {
    align-items: flex-start;
  }

  .site-footer__link {
    text-align: left;
  }

  /* Popup */
  .popup {
    padding: 16px;
    align-items: flex-end;
  }

  .popup__dialog {
    display: flex;
    flex-direction: column;
    max-width: none;
    max-height: calc(100dvh - 24px);
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* Keep the close control reachable while the dialog scrolls. */
  .popup__close {
    position: sticky;
    top: 8px;
    margin: 0 8px -40px auto;
  }

  .popup__layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .popup__visual img {
    min-height: 220px;
    max-height: 240px;
    object-position: top center;
  }

  .popup__body {
    padding: 32px 24px 24px;
  }

  .popup__title {
    font-size: 20px;
    padding-right: 32px;
  }

  .popup__subtitle {
    margin-bottom: 24px;
  }
}

@media (max-width: 374px) {
  .header-nav-btn {
    font-size: 10px;
  }

  .site-header__callback {
    max-width: 96px;
    text-align: right;
    line-height: 1.3;
  }

  .hero__title {
    font-size: 24px;
  }
}

/* Short viewports (e.g. phones in landscape): drop the popup's decorative
   image so the form fields and submit button always fit on screen. */
@media (max-height: 720px) and (max-width: 767px) {
  .popup__visual {
    display: none;
  }

  .popup__body {
    padding: 20px 24px 24px;
  }
}
