/* =========================================================
   RESPONSIVE ADJUSTMENTS
   These rules keep the landing page readable and balanced
   across tablet, mobile, and reduced-motion environments.
   ========================================================= */

/* ---------------------------------------------------------
   Desktop/tablet transition: pricing cards expand to two columns
   without disturbing the main SaaS layout on mid-sized screens.
   --------------------------------------------------------- */
@media (max-width: 1050px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------------------------------------------------------
   Tablet layout: stack major content blocks while preserving
   the hero, feature cards, and footer hierarchy.
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero {
    padding: 78px 0 66px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }
  .hero-copy {
    max-width: 680px;
    margin: auto;
    text-align: center;
  }
  .hero-description {
    margin-inline: auto;
  }
  .hero-actions,
  .proof-points {
    justify-content: center;
  }
  .product-preview {
    max-width: 650px;
    margin: auto;
    aspect-ratio: 1.5 / 1;
  }
  .feature-grid,
  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-card:last-child {
    grid-column: 1 / -1;
  }
  .price-card {
    padding-inline: 23px;
  }
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .section-heading--left {
    margin-bottom: 30px;
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .footer-grid > div:last-child {
    grid-column: 1 / -1;
    max-width: 350px;
  }
  .hero {
    min-height: 0;
    padding-top: 88px;
  }
}

/* ---------------------------------------------------------
   Compact navigation: tighten header spacing and keep dark mode
   mobile nav styling consistent on smaller screens.
   --------------------------------------------------------- */
@media (max-width: 700px) {
  .navigation {
    min-height: 70px;
  }
  .nav-menu ul {
    gap: 3px;
  }
  .theme-toggle {
    width: 35px;
    height: 35px;
  }
  .nav-actions {
    gap: 12px;
  }
  body.dark-theme .nav-menu {
    background: #1b1a31;
  }
}

/* ---------------------------------------------------------
   Mobile layout: convert sections to single-column flow, collapse
   navigation, and reduce floating UI sizes for handheld screens.
   --------------------------------------------------------- */
@media (max-width: 620px) {
  .container {
    width: min(var(--container), calc(100% - 32px));
  }
  .mobile-cta-bar {
    display: none !important;
    bottom: 12px;
  }
  .navigation {
    min-height: 67px;
  }
  .menu-button {
    display: block;
    z-index: 2;
    margin-left: auto;
  }
  .chat-widget {
    right: 16px;
    bottom: 16px;
  }
  .chat-toggle {
    width: 52px;
    min-height: 52px;
    justify-content: center;
    padding: 0;
  }
  .chat-toggle span {
    display: none;
  }
  .chat-panel {
    right: 0;
    bottom: 66px;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: grid;
    gap: 21px;
    padding: 23px 16px 25px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 22px rgba(24, 26, 63, 0.07);
    transform: translateY(-10px);
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
  }
  .nav-menu.is-open {
    transform: none;
    visibility: visible;
    opacity: 1;
  }
  .menu-button[aria-expanded="true"] span:first-child {
    transform: translateY(6px) rotate(45deg);
  }
  .menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .menu-button[aria-expanded="true"] span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }
  .nav-menu ul {
    display: grid;
    gap: 3px;
    margin: 0;
  }
  .nav-menu li a {
    display: block;
    padding: 10px 2px;
  }
  .nav-actions {
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .hero h1 {
    font-size: 42px;
  }
  .logo-strip .container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
    padding: 25px 0;
    text-align: center;
    font-size: 17px;
  }
  .logo-strip small {
    grid-column: 1 / -1;
  }
  .section {
    padding: 76px 0;
  }
  .section-heading {
    margin-bottom: 38px;
  }
  .feature-grid,
  .pricing-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }
  .feature-card:last-child {
    grid-column: auto;
  }
  .feature-card p,
  .testimonial-grid blockquote {
    min-height: auto;
  }
  .metrics .container {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 12px;
    padding: 38px 0;
  }
  .metrics strong {
    font-size: 35px;
  }
  .process {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .process::before {
    top: 24px;
    bottom: 24px;
    left: 27px;
    right: auto;
    width: 1px;
    height: auto;
  }
  .process li {
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 19px;
  }
  .process li > span {
    grid-row: span 2;
    margin: 0;
  }
  .process h3 {
    align-self: end;
    margin-bottom: 3px;
  }
  .process p {
    grid-column: 2;
  }
  .pricing-grid {
    gap: 28px;
  }
  .price-card {
    padding: 34px 29px 29px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 29px;
  }
  .footer-grid > div:first-child,
  .footer-grid > div:last-child {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    gap: 15px;
    margin-top: 36px;
  }
  .growth-card {
    bottom: 16px;
    left: -8px;
  }
  .auth-dialog {
    padding: 30px 22px 24px;
  }
  .account-status {
    display: none;
  }
  .chat-messages {
    min-height: 220px;
    max-height: min(330px, 42vh);
  }
  .checkout-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .card-preview {
    min-height: 138px;
  }
  .card-preview strong {
    font-size: 17px;
  }
  .hero {
    padding-top: 72px;
    background-size:
      34px 34px,
      34px 34px,
      auto;
  }
  .hero h1 {
    font-size: 43px;
  }
  .price-card--featured,
  .price-card--featured:hover {
    transform: none;
  }
  .product-preview {
    aspect-ratio: 1.5 / 1;
  }
}

/* ---------------------------------------------------------
   Small handset refinements: reduce typography and spacing for
   tighter viewport widths while preserving usability.
   --------------------------------------------------------- */
@media (max-width: 390px) {
  .hero h1 {
    font-size: 36px;
  }
  .proof-points {
    gap: 17px;
  }
  .proof-points strong {
    font-size: 18px;
  }
  .proof-points span {
    font-size: 11px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------
   Motion preference: disable smooth scrolling and transitions
   for users who prefer reduced motion.
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
