/* Additive mobile adaptations. Does not alter the original desktop design. */

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

@media (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  img,
  video,
  svg,
  iframe,
  canvas,
  table {
    max-width: 100%;
  }

  img,
  video {
    height: auto;
  }

  iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
  }

  pre,
  code {
    white-space: pre-wrap;
    word-break: break-word;
  }

  pre {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .container,
  .header-container,
  .footer-content,
  .faq-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-heading {
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
    line-height: 1.15;
    word-break: break-word;
  }

  .hero-description,
  .section-description {
    font-size: 1rem;
    line-height: 1.6;
  }

  .hero-actions,
  .btn-row,
  .btn-row-primary,
  .btn-row-support,
  .badges-container,
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .btn,
  .btn-download-main,
  .btn-nav-download,
  .copy-btn,
  .icon-btn {
    min-height: 44px;
  }

  .btn-download-main,
  .btn-demo,
  .btn-docs {
    width: 100%;
    max-width: 22rem;
    justify-content: center;
  }

  .docs-grid,
  .features-grid,
  .footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .feature-item,
  .feature-text,
  .feature-image {
    width: 100%;
    text-align: left;
  }

  .faq-question {
    font-size: 1rem;
    text-align: left;
    gap: 0.75rem;
  }

  .hero-info-line {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.35rem;
    text-align: center;
  }

  .info-separator {
    display: none;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.25rem;
  }

  .badges-container,
  .footer-links {
    gap: 0.5rem;
  }

  .docs-card {
    padding: 1rem;
  }
}

/* Marquee rows can overflow the viewport on narrow screens. */
@media (max-width: 768px) {
  .sponsors-scroll,
  .media-scroll,
  .sponsor-track,
  .media-track {
    max-width: 100vw;
    overflow: hidden;
  }
}

/* 404 page helper links (visual parity with site link styling) */
.notfound-links li { margin: 8px 0; }
.notfound-links a { color: var(--primary-color, #FFD700); text-decoration: none; }
.notfound-links a:hover { text-decoration: underline; }
#not-found h1 { margin-bottom: 20px; }
@media (max-width: 768px) {
    #not-found .container { padding: 120px 20px 60px !important; }
}
