/* ProAI Expert v139 — mobile stabilization pass */
@media (max-width: 980px) {
  /* HOME portrait: keep header-safe start and center the scene consistently */
  body.page-home #hero {
    padding-top: calc(var(--header-h, 78px) + 14px) !important;
    padding-bottom: 16px !important;
    min-height: auto !important;
  }
  body.page-home .hero-content {
    gap: 12px !important;
    padding-top: 24px !important;
    padding-bottom: 12px !important;
    align-items: flex-start !important;
  }
  body.page-home .hero-label {
    margin-bottom: 12px !important;
  }
  body.page-home .hero-left {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  body.page-home .hero-left h1 {
    margin-bottom: 14px !important;
  }
  body.page-home .hero-left p {
    margin-bottom: 18px !important;
  }
  body.page-home .hero-visual {
    min-height: 344px !important;
    margin-top: 14px !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  body.page-home .scene {
    min-height: 344px !important;
    transform: translate3d(0, 18px, 0) scale(0.88) !important;
    transform-origin: top center !important;
  }

  /* ABOUT portrait: normalize RU/EN hero rhythm and founder card layout */
  body.page-about .hero,
  body.page-about .about-hero {
    padding-top: calc(var(--header-h, 78px) + 18px) !important;
    padding-bottom: 30px !important;
  }
  body.page-about .hero-grid,
  body.page-about .about-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    align-items: start !important;
  }
  body.page-about .hero-copy {
    max-width: 100% !important;
  }
  body.page-about .hero-copy h1 {
    max-width: 11ch !important;
    font-size: clamp(32px, 8.7vw, 50px) !important;
    line-height: 0.96 !important;
    letter-spacing: -1.8px !important;
    margin-bottom: 16px !important;
  }
  body.page-about .hero-copy p {
    max-width: 100% !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  body.page-about .hero-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-top: 22px !important;
  }
  body.page-about .hero-actions a {
    width: 100% !important;
    max-width: 360px !important;
    justify-content: center !important;
  }
  body.page-about .anchor-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 24px 20px !important;
  }
  body.page-about .anchor-inner,
  body.page-about .anchor-card-inner {
    grid-template-columns: minmax(104px, 114px) minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: start !important;
  }
  body.page-about .anchor-photo-wrap,
  body.page-about .anchor-photo {
    border-radius: 20px !important;
  }
  body.page-about .anchor-card h3 {
    font-size: 26px !important;
    line-height: 1.02 !important;
    margin-bottom: 8px !important;
  }
  body.page-about .anchor-role {
    font-size: 11px !important;
    letter-spacing: 1.8px !important;
    margin-bottom: 14px !important;
  }
  body.page-about .anchor-card p {
    font-size: 15px !important;
    line-height: 1.58 !important;
  }

  /* ABOUT content sections: keep stacked layout stable */
  body.page-about #thesis .shell > div,
  body.page-about #anchor .shell > div,
  body.page-about #disciplines .shell > div,
  body.page-about #proof .shell > div,
  body.page-about #why .shell > div,
  body.page-about #thesis .section-shell > div,
  body.page-about #anchor .section-shell > div,
  body.page-about #disciplines .section-shell > div,
  body.page-about #proof .section-shell > div,
  body.page-about #why .section-shell > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    align-items: start !important;
  }
  body.page-about #thesis .panel {
    min-height: auto !important;
    padding: 18px !important;
  }
  body.page-about #thesis .panel [style*="position:absolute"] {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 12px 0 !important;
    transform: none !important;
  }
  body.page-about #disciplines article.panel,
  body.page-about #proof .panel,
  body.page-about #why .panel,
  body.page-about #anchor .panel {
    min-height: auto !important;
    padding: 18px !important;
  }
  body.page-about #disciplines .panel > div[style*="grid-template-columns:repeat(2,minmax(0,1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  body.page-about #proof .shell > div > div:last-child,
  body.page-about #why .shell > div > div:first-child,
  body.page-about #proof .section-shell > div > div:last-child,
  body.page-about #why .section-shell > div > div:first-child {
    border-left: 0 !important;
    padding: 0 !important;
    font-size: 17px !important;
    line-height: 1.58 !important;
  }
  body.page-about #proof .shell > div > div:last-child,
  body.page-about #why .shell > div > div:last-child,
  body.page-about #anchor .shell > div > div:last-child,
  body.page-about #thesis .shell > div > div:last-child,
  body.page-about #disciplines .shell > div > div:last-child,
  body.page-about #proof .section-shell > div > div:last-child,
  body.page-about #why .section-shell > div > div:last-child,
  body.page-about #anchor .section-shell > div > div:last-child,
  body.page-about #thesis .section-shell > div > div:last-child,
  body.page-about #disciplines .section-shell > div > div:last-child {
    max-width: 100% !important;
  }
  body.page-about #thesis .shell > div > div:first-child > div > div,
  body.page-about #anchor p,
  body.page-about #disciplines article.panel p,
  body.page-about #proof .panel span,
  body.page-about #why .panel,
  body.page-about #why .shell > div > div:first-child,
  body.page-about #thesis .section-shell > div > div:first-child > div > div,
  body.page-about #why .section-shell > div > div:first-child {
    font-size: 15px !important;
    line-height: 1.62 !important;
    max-width: 100% !important;
  }

  /* Websites & Branding portrait: keep hero clear of header and center artwork */
  body.theme-web #hero {
    padding-top: calc(var(--header-h, 78px) + 18px) !important;
    padding-bottom: 24px !important;
    min-height: auto !important;
  }
  body.theme-web .hero-shell {
    gap: 18px !important;
    align-items: start !important;
    padding-top: 20px !important;
  }
  body.theme-web .hero-copy .eyebrow {
    margin-bottom: 12px !important;
  }
  body.theme-web .hero-copy h1 {
    max-width: 8.6ch !important;
    font-size: clamp(33px, 8.8vw, 50px) !important;
    line-height: 0.96 !important;
    letter-spacing: -1.7px !important;
    margin-bottom: 16px !important;
  }
  body.lang-ru.theme-web .hero-copy h1 {
    max-width: 8.3ch !important;
    font-size: clamp(31px, 8.3vw, 46px) !important;
  }
  body.theme-web .hero-copy p {
    font-size: 15px !important;
    line-height: 1.58 !important;
    margin-bottom: 20px !important;
    max-width: 100% !important;
  }
  body.theme-web .hero-visual {
    min-height: 402px !important;
    margin-top: 8px !important;
    align-items: flex-start !important;
    justify-content: center !important;
  }
  body.theme-web .hero-embed {
    width: min(106%, 620px) !important;
    height: clamp(350px, 50vh, 430px) !important;
    margin: 0 auto !important;
    transform: translateY(16px) !important;
    transform-origin: top center !important;
  }

  /* INSIGHTS portrait: remove excess void */
  .insights-hero {
    padding-top: calc(var(--header-h, 78px) + 10px) !important;
    padding-bottom: 26px !important;
  }
}

@media (max-width: 1100px) and (orientation: landscape), (max-height: 540px) {
  /* HOME landscape: keep label clear of header and hold one stable focal center */
  body.page-home #hero {
    padding-top: calc(var(--header-h, 78px) + 10px) !important;
    padding-bottom: 14px !important;
    min-height: auto !important;
  }
  body.page-home .hero-content {
    padding-top: 18px !important;
    padding-bottom: 8px !important;
    gap: 18px !important;
    align-items: flex-start !important;
  }
  body.page-home .hero-left {
    width: min(45%, 344px) !important;
    flex: 0 0 45% !important;
    padding-top: 8px !important;
  }
  body.page-home .hero-visual {
    width: 55% !important;
    min-height: 268px !important;
    margin-top: 10px !important;
    align-items: flex-start !important;
    justify-content: center !important;
  }
  body.page-home .scene {
    min-height: 268px !important;
    transform: translate3d(0, 18px, 0) scale(0.86) !important;
    transform-origin: top center !important;
  }

  /* ABOUT landscape: same hero system for RU and EN */
  body.page-about .hero,
  body.page-about .about-hero {
    padding-top: calc(var(--header-h, 78px) + 12px) !important;
    padding-bottom: 20px !important;
  }
  body.page-about .hero-grid,
  body.page-about .about-grid {
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 0.92fr) !important;
    gap: 18px !important;
    align-items: start !important;
  }
  body.page-about .hero-copy h1 {
    max-width: 11ch !important;
    font-size: clamp(30px, 4.8vw, 42px) !important;
    line-height: 0.95 !important;
    letter-spacing: -1.4px !important;
  }
  body.page-about .hero-copy p {
    font-size: 14px !important;
    line-height: 1.55 !important;
    margin-bottom: 0 !important;
  }
  body.page-about .hero-actions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 18px !important;
    align-items: center !important;
  }
  body.page-about .hero-actions a {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }
  body.page-about .anchor-card {
    padding: 22px 20px !important;
  }
  body.page-about .anchor-inner,
  body.page-about .anchor-card-inner {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  body.page-about #thesis .shell > div,
  body.page-about #anchor .shell > div,
  body.page-about #disciplines .shell > div,
  body.page-about #proof .shell > div,
  body.page-about #why .shell > div,
  body.page-about #thesis .section-shell > div,
  body.page-about #anchor .section-shell > div,
  body.page-about #disciplines .section-shell > div,
  body.page-about #proof .section-shell > div,
  body.page-about #why .section-shell > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    align-items: start !important;
  }
  body.page-about #thesis .panel [style*="position:absolute"] {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 10px 0 !important;
    transform: none !important;
  }
  body.page-about #disciplines .panel > div[style*="grid-template-columns:repeat(2,minmax(0,1fr))"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }
  body.page-about #proof .shell > div > div:last-child,
  body.page-about #why .shell > div > div:first-child,
  body.page-about #proof .section-shell > div > div:last-child,
  body.page-about #why .section-shell > div > div:first-child {
    border-left: 0 !important;
    padding: 0 !important;
  }

  /* Websites & Branding landscape: restore top clearance and center the artwork */
  body.theme-web #hero {
    padding-top: calc(var(--header-h, 78px) + 12px) !important;
    padding-bottom: 14px !important;
    min-height: auto !important;
  }
  body.theme-web .hero-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 18px !important;
    padding-top: 12px !important;
  }
  body.theme-web .hero-copy {
    padding-top: 8px !important;
  }
  body.theme-web .hero-copy .eyebrow {
    margin-bottom: 10px !important;
  }
  body.theme-web .hero-copy h1 {
    max-width: 8.6ch !important;
    font-size: clamp(28px, 4.7vw, 40px) !important;
    line-height: 0.95 !important;
    letter-spacing: -1.3px !important;
  }
  body.lang-ru.theme-web .hero-copy h1 {
    max-width: 8.2ch !important;
    font-size: clamp(27px, 4.4vw, 38px) !important;
  }
  body.theme-web .hero-copy p {
    font-size: 13px !important;
    line-height: 1.52 !important;
    margin-bottom: 14px !important;
    max-width: 42ch !important;
  }
  body.theme-web .hero-visual {
    min-height: 286px !important;
    margin-top: 8px !important;
    align-items: flex-start !important;
    justify-content: center !important;
  }
  body.theme-web .hero-embed {
    width: min(100%, 640px) !important;
    height: clamp(250px, 54svh, 310px) !important;
    margin: 0 auto !important;
    transform: translateY(12px) !important;
    transform-origin: top center !important;
  }

  /* INSIGHTS landscape: reduce empty band */
  .insights-hero {
    padding-top: calc(var(--header-h, 78px) + 4px) !important;
    padding-bottom: 18px !important;
  }

  /* AI / WEB lower entropy maps: avoid overlapping cards entirely */
  body.theme-ai #entropy .entropy-map,
  body.theme-web #entropy .entropy-map {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 14px !important;
  }
  body.theme-ai #entropy .entropy-card,
  body.theme-web #entropy .entropy-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
  }

  /* Showcase landscape: keep support devices readable */
  .showcase-proof-visual {
    min-height: 300px !important;
  }
  .showcase-proof-stage {
    min-height: 300px !important;
  }
  .showcase-proof-card.primary-desktop {
    width: min(70%, 360px) !important;
    left: 4% !important;
    top: 6px !important;
  }
  .showcase-proof-card.secondary-desktop {
    width: min(32%, 136px) !important;
    left: 24% !important;
    bottom: 18px !important;
  }
  .showcase-proof-phone.primary-phone {
    width: min(19%, 82px) !important;
    right: 6% !important;
    bottom: 16px !important;
  }
}
