/* Responsive layout */

body {
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  :root {
    --nav-h: 60px;
  }

  .container {
    width: min(100% - 1.25rem, var(--max));
  }
}

.site-header {
  z-index: 200;
}

.site-header .header-inner {
  position: relative;
  z-index: 202;
}

.nav-backdrop {
  z-index: 199;
}

@media (max-width: 900px) {
  .site-header nav.site-nav {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 201;
    pointer-events: none;
    display: flex;
    justify-content: center;
    padding: 0.65rem 1rem 0;
  }

  .site-header nav.site-nav .nav-links {
    pointer-events: auto;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
    padding: 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    text-align: center;
  }

  .btn-contact span,
  .nav-actions .btn-contact,
  .nav-actions .btn-dashboard {
    font-size: 0.8rem;
  }
}

@media (max-width: 959px) {
  .hero {
    min-height: auto;
    align-items: center;
  }

  .hero-content {
    padding: 3rem 0 2.75rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.1rem 0;
  }

  .stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    padding: 0.15rem 0;
  }

  .stat strong {
    font-size: 1.25rem;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .feature-list li,
  .feature-list li:nth-child(odd),
  .feature-list li:nth-child(even) {
    padding: 1.15rem 0;
    border-right: none;
  }

  .price-row {
    grid-template-columns: 1fr;
  }

  .footer-inner,
  .footer-cols {
    grid-template-columns: 1fr;
  }

  .commands-layout {
    grid-template-columns: 1fr;
  }

  .commands-sidebar {
    position: static;
    max-height: none;
  }

  .cat-nav {
    max-height: min(40vh, 320px);
    overflow-y: auto;
  }

  .search-box input {
    font-size: 16px;
  }
}

@media (max-width: 599px) {
  .hero-brand {
    font-size: clamp(2.4rem, 14vw, 3.4rem);
  }

  .hero-cta {
    width: 100%;
  }

  .hero-cta .btn {
    flex: 1 1 auto;
    min-height: 46px;
  }

  .cmd-head {
    flex-direction: column;
  }

  .commands-pagination .page-btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .page-info {
    width: 100%;
    text-align: center;
    order: -1;
  }
}
