/* Mobile / tablet layout — loaded after each page's own styles */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }

  /* Navigation: logo on top, links in a swipeable row beneath */
  nav { height: auto !important; flex-wrap: wrap; padding: 8px 16px 0 !important; row-gap: 6px; }
  .nav-logo { gap: 10px; }
  .nav-logo-main { font-size: 13px; }
  .nav-links { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { flex: 0 0 auto; }
  .nav-links li:first-child { border-left: none; }
  .nav-links a { padding: 0 14px !important; height: 40px !important; line-height: 40px !important; white-space: nowrap; }

  /* Single-column stacking for every two/three-column block */
  .hero, .paper-hero, .framework, .papers-header, .persp-header, .persp-bottom,
  .tools, .authors-grid, .community-top, .community-body, .paper-body, .paper-cta,
  .insights-grid, footer { grid-template-columns: minmax(0,1fr) !important; }
  .persp-cards, .persp-grid, .more-papers-grid, .tools-compare { grid-template-columns: minmax(0,1fr) !important; }
  .hero, .paper-hero { min-height: 0 !important; padding-top: 104px !important; }

  /* Padding: 40px gutters become 20px */
  .hero-left, .ph-left { padding: 40px 20px 32px !important; border-right: none !important; }
  .hero-right-content, .ph-right { padding: 24px 20px 32px !important; }
  .framework-left, .papers-header-left, .papers-header-right, .persp-header-left, .persp-header-right,
  .tools-left, .tools-right, .community-form-col, .community-features-col,
  .paper-section, .authors-header, .author-info, .paper-cta, .community-top { padding-left: 20px !important; padding-right: 20px !important; }
  .framework-left, .papers-header-left, .persp-header-left, .tools-left, .community-form-col { border-right: none !important; }
  .paper-main { border-right: none !important; }
  .papers-header-left, .papers-header-right, .persp-header-left, .persp-header-right,
  .tools-left, .tools-right { padding-top: 36px !important; padding-bottom: 36px !important; }
  .paper-section { padding-top: 40px !important; padding-bottom: 40px !important; }
  .community-top { gap: 24px !important; padding-top: 48px !important; padding-bottom: 36px !important; }
  .paper-cta { gap: 24px !important; padding-top: 48px !important; padding-bottom: 48px !important; }
  .authors-header { flex-direction: column; align-items: flex-start !important; gap: 16px; }
  .footer-cell { padding: 20px !important; border-right: none !important; border-bottom: 1px solid rgba(240,239,233,0.08); }

  /* Hero pieces */
  .hero-bg-word { font-size: 120px !important; }
  .ph-bg-num { font-size: 180px !important; }
  .ph-series { font-size: 72px !important; }
  .hero-title, h1 { overflow-wrap: anywhere; }
  .hero-stats-row { flex-wrap: wrap; }
  .hero-stat { padding: 16px 20px !important; flex: 1 1 33%; }
  .hero-authors-strip { padding: 14px 20px !important; flex-wrap: wrap; }
  .hero-quote { font-size: 17px; }
  .hero-quote-authors { flex-wrap: wrap; }

  /* Download buttons and form rows */
  .ph-download-row { flex-wrap: wrap; gap: 8px; }
  .ph-dl-btn { padding: 12px 18px; }
  .ph-dl-ghost { border-left: 1px solid var(--rule) !important; }
  .form-row { grid-template-columns: minmax(0,1fr) !important; }

  /* Framework layers */
  .fw-layer { grid-template-columns: 48px 1fr !important; }
  .fw-layer > :nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
  .fw-layer-body { padding: 20px !important; }
  .stack-layer { grid-template-columns: 32px 1fr !important; }
  .stack-layer > :nth-child(3) { grid-column: 1 / -1; }

  /* Paper rows on the home page: colour bar | text | arrow, concepts below */
  .paper-entry { grid-template-columns: 6px 1fr 44px !important; }
  .pe-body { padding: 18px 16px !important; }
  .pe-concepts { grid-column: 2 / 4; grid-row: 2; flex-direction: row !important; flex-wrap: wrap; border-left: none !important; padding: 0 16px 16px !important; }
  .pe-arrow { grid-row: 1; grid-column: 3; }

  .post-card { border-right: none !important; border-bottom: 1px solid var(--rule); min-width: 0; }
  .persp-social-bar { flex-wrap: wrap; }
  .social-btn { padding: 10px 14px; }
  .tools-compare { margin-top: 28px; }
  img { max-width: 100%; height: auto; }
  .gate-box { max-width: calc(100vw - 32px); }
}

@media (max-width: 480px) {
  .hero-stat-num { font-size: 34px !important; }
  .btn-primary, .btn-ghost { padding: 13px 20px !important; }
  .hero-actions, .hero-btns { flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .hero > *, .framework > *, .papers-header > *, .persp-header > *, .tools > *, .community-top > *, .community-body > *,
  .authors-grid > *, .paper-hero > *, .paper-body > *, .paper-cta > * { min-width: 0; }
  .hero-stat { min-width: 0; padding: 14px 12px !important; }
  .hero-stat-label { letter-spacing: 0.06em; }
  .hero-right { overflow: hidden; }
}

@media (max-width: 900px) {
  .community-big, .persp-title, .authors-big, .papers-title, .tools-title { font-size: clamp(40px, 12vw, 56px) !important; overflow-wrap: anywhere; }
}
