/* Shared mobile / responsive polish for HX-F */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* Touch: avoid sticky hover lifts */
@media (hover: none) {
  .belief-card:hover,
  .stat-card:hover,
  .pillar-item:hover .pillar-card,
  .arch-card:hover,
  .framework-card:hover,
  .team-card:hover,
  .consensus-card:hover,
  .partner-item:hover,
  .contact-box:hover {
    transform: none;
    box-shadow: inherit;
  }
}

@media (max-width: 992px) {
  .reveal,
  .reveal-left {
    transform: translateY(20px);
  }

  .reveal-left {
    transform: translateY(20px);
  }

  .reveal.is-visible,
  .reveal-left.is-visible,
  .reveal-scale.is-visible {
    transform: none;
  }
}

@media (max-width: 992px) {
  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .header {
    height: auto;
    min-height: var(--header-h, 68px);
    padding-top: env(safe-area-inset-top);
  }

  .menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .mobile-nav {
    max-height: min(78vh, 560px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .mobile-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 16px;
  }

  /* Heroes */
  .hero,
  .core-hero,
  .section.hero {
    min-height: auto !important;
  }

  .hero-inner,
  .core-hero-inner,
  .hero-content {
    min-height: auto !important;
    padding-top: 72px !important;
    padding-bottom: 36px !important;
    padding-left: 0 !important;
  }

  .hero-copy,
  .core-hero-copy {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .hero-copy h1,
  .core-hero-copy h1 {
    white-space: normal !important;
    font-size: clamp(26px, 7.2vw, 40px) !important;
    line-height: 1.18 !important;
    margin-bottom: 14px !important;
    word-break: break-word;
  }

  .hero-copy p,
  .hero-copy .en,
  .hero-copy .cn,
  .hero-copy .line1,
  .hero-copy .line2,
  .core-hero-copy .en,
  .core-hero-copy .cn {
    font-size: clamp(14px, 3.8vw, 17px) !important;
    line-height: 1.7 !important;
    max-width: 100% !important;
  }

  /* Decorative side art — hide on tablet/phone to free space */
  .belief-left,
  .belief-deco {
    display: none !important;
  }

  /* Common grids → stack */
  .belief-cards,
  .stats-row,
  .result-stats,
  .consensus-cards,
  .arch-cards,
  .framework-cards,
  .pillars-list,
  .content-grid,
  .arch-top,
  .about-top,
  .hero-stats-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    max-width: 100% !important;
  }

  .pillar-item {
    width: 100%;
  }

  .pillar-card,
  .arch-card,
  .framework-card,
  .belief-card {
    width: 100%;
  }

  /* Team */
  .team-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .team-card {
    grid-template-columns: 120px 1fr !important;
    min-height: auto !important;
  }

  .team-photo {
    min-height: 160px !important;
  }

  .team-info {
    padding: 18px 16px 16px !important;
  }

  .team-info h3 {
    font-size: 18px !important;
  }

  .team-info .role {
    font-size: 14px !important;
    margin-bottom: 10px !important;
  }

  .team-info .desc {
    font-size: 13px !important;
    line-height: 1.7 !important;
    max-width: 100% !important;
  }

  /* Partner logos */
  .partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    justify-items: center;
  }

  .partner-item {
    width: 100%;
  }

  /* Practice map: already stacks in page CSS; ensure spacing */
  .validation-map {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .map-item {
    position: static !important;
    width: 100% !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
  }

  .ring-bg {
    display: none;
  }

  /* Contact pill */
  .contact-box {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: nowrap;
  }

  .contact-box-center {
    min-width: 0;
    overflow: hidden;
  }

  .contact-box-center .value {
    word-break: break-all;
    font-size: 14px;
  }

  /* Footer */
  .footer {
    padding: 36px 16px max(24px, env(safe-area-inset-bottom)) !important;
  }

  .footer-grid,
  .footer-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
  }

  .footer-right {
    width: 100% !important;
    align-items: flex-start !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }

  .footer-badge {
    justify-content: flex-start !important;
  }

  .footer-text {
    max-width: 100% !important;
    text-align: left !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    word-break: break-word;
  }

  /* Section titles */
  .node-section h2,
  .section-head h2,
  .result-head h2,
  .pillars-head h2,
  .belief-head h3,
  .belief-head .title {
    font-size: clamp(24px, 6.5vw, 32px) !important;
  }

  .node-section .desc,
  .belief-desc {
    font-size: 14px !important;
    line-height: 1.75 !important;
    padding: 0 4px;
  }
}

@media (max-width: 576px) {
  .hero-inner,
  .core-hero-inner,
  .hero-content {
    padding-top: 56px !important;
    padding-bottom: 28px !important;
  }

  .hero-copy h1,
  .core-hero-copy h1 {
    font-size: clamp(24px, 7.5vw, 30px) !important;
  }

  .hero-stats {
    padding: 28px 0 40px !important;
  }

  .hero-slogan {
    font-size: 15px !important;
    line-height: 1.55 !important;
    margin-bottom: 20px !important;
    padding: 0 4px;
  }

  .stat-center,
  .stat-card {
    text-align: center !important;
  }

  .stat-center .num,
  .stat-card .num,
  .result-stats .num {
    font-size: 36px !important;
  }

  .partner-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .team-card {
    grid-template-columns: 1fr !important;
  }

  .team-photo {
    min-height: 220px !important;
    max-height: 260px;
  }

  .team-photo img {
    object-fit: cover;
    object-position: center top;
  }

  .content-illus,
  .arch-illus,
  .about-art {
    margin-top: 8px;
  }

  .content-illus img,
  .arch-illus img,
  .about-art img {
    margin: 0 auto;
  }

  /* Timeline summary bar */
  .timeline-summary {
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
  }

  .data-section,
  .belief-section,
  .about-section {
    padding-left: 0;
    padding-right: 0;
  }

  .data-copy {
    margin-left: 0 !important;
    max-width: 100% !important;
  }

  .data-copy .line3 {
    font-size: 28px !important;
  }

  .data-copy .line4 {
    font-size: 12px !important;
    word-break: break-word;
  }

  .about-copy .en-title {
    font-size: 32px !important;
  }

  .about-copy .cn-title {
    font-size: 24px !important;
  }

  .about-copy h3 {
    font-size: 18px !important;
  }

  .about-copy p {
    font-size: 14px !important;
    line-height: 1.75 !important;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero-copy h1,
  .core-hero-copy h1 {
    font-size: 22px !important;
  }

  .partner-grid {
    grid-template-columns: 1fr !important;
  }

  .footer-text {
    font-size: 11px !important;
  }
}
