/* =============================================================
   Breakpoints Rules
============================================================= */

/* -------------------------------------------------------------
   Laptop Viewport (1200px and under)
------------------------------------------------------------- */
@media (max-width: 1200px) {
  :root {
    --fs-hero: 54px;
    --fs-h2: 40px;
    --section-padding: 96px;
  }
  
  .container {
    max-width: 960px;
  }

  .navbar {
    max-width: 100%;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .feature-card {
    padding: 28px;
  }

  .styles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .style-card {
    height: 360px;
  }
}

/* -------------------------------------------------------------
   Tablet Viewport (992px and under)
------------------------------------------------------------- */
@media (max-width: 992px) {
  :root {
    --fs-hero: 48px;
    --fs-h2: 36px;
    --fs-body: 17px;
    --section-padding: 80px;
  }

  .container {
    max-width: 720px;
  }

  /* Hero Section */
  .hero-title {
    max-width: 100%;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Timeline adapts to vertical on small tablets */
  .timeline {
    flex-direction: column;
    gap: 40px;
    margin: 40px auto 0 auto;
    max-width: 480px;
  }

  .timeline::before {
    top: 40px;
    left: 40px;
    width: 2px;
    height: 80%;
  }

  .timeline-step {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 24px;
  }

  .step-icon-container {
    margin-bottom: 0;
  }

  .step-number {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
  }

  /* Privacy layout */
  .privacy-container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .privacy-illustration {
    order: -1; /* Display browser illustration first on mobile/tablet */
  }

  /* Languages Section */
  .languages-wrapper {
    padding: 40px 24px;
  }

  /* Comparison table — keep it fitting the container (no forced scroll). */
  .comparison-table th,
  .comparison-table td {
    padding: 18px 20px;
  }

  /* Footer layout */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* -------------------------------------------------------------
   Mobile Viewport (768px and under)
------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --fs-hero: 38px;
    --fs-h2: 30px;
    --fs-body: 16px;
    --section-padding: 64px;
  }

  .container {
    max-width: 540px;
  }

  /* Inset the rounded navbar from the screen edges on mobile. */
  .navbar {
    margin: 0 16px;
    padding: 10px 20px;
  }

  /* Sticky Header Menu */
  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  /* Toggle mobile hamburger menu state */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .nav-menu {
    position: absolute;
    top: 80px;
    left: 24px;
    right: 24px;
    flex-direction: column;
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: var(--transition-smooth);
    z-index: 999;
  }

  .nav-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-actions {
    display: none; /* Hide desktop auth actions or place inside mobile menu if desired */
  }

  .nav-menu .btn-primary {
    width: 100%;
    margin-top: 16px;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  /* Comparison table — fit within the screen instead of scrolling. */
  .comparison-table-wrapper {
    overflow: hidden;
    width: 100%;
  }

  .comparison-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 12px 8px;
    font-size: 12px;
  }

  /* Let feature labels wrap between words, but don't break words mid-letter
     (that's what produced "Tradi- tional" and the cramped look). */
  .comparison-table td:first-child {
    overflow-wrap: break-word;
  }
  .comparison-table th {
    font-size: 12px;
    line-height: 1.25;
  }

  /* Give the feature column the bulk of the width and the two result columns
     a fixed, sensible share so their headers don't wrap into narrow stacks. */
  .comparison-table th:first-child,
  .comparison-table td:first-child {
    width: 58%;
  }

  .comparison-table th:nth-child(2),
  .comparison-table th:nth-child(3),
  .comparison-table td:nth-child(2),
  .comparison-table td:nth-child(3) {
    width: 21%;
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
  }

  /* Hero Section */
  .hero {
    padding-top: 140px;
    padding-bottom: 60px;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 24px auto;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .hero-trust {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 48px;
  }

  .hero-trust span:not(:last-child)::after {
    display: none;
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Styles Section */
  .styles-grid {
    grid-template-columns: 1fr;
  }

  .style-card {
    height: 340px;
  }

  /* Style carousel — shrink cards & tighten spread on tablets/phones. */
  .carousel-stage {
    height: 460px;
  }
  .showcase-card,
  .showcase-frame {
    width: 230px;
  }
  .style-carousel {
    gap: 6px;
  }
  .carousel-arrow {
    width: 40px;
    height: 40px;
  }

  /* CTA Section */
  .cta-banner {
    padding: 60px 24px;
  }

  .cta-banner .section-title {
    font-size: 32px;
  }
}

/* -------------------------------------------------------------
   Small Mobile Viewport (480px and under)
------------------------------------------------------------- */
@media (max-width: 480px) {
  :root {
    --fs-hero: 34px;
    --fs-h2: 26px;
    --fs-body: 15px;
    --section-padding: 48px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .navbar {
    padding: 8px 16px;
  }

  .nav-menu {
    left: 16px;
    right: 16px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .timeline-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .timeline::before {
    display: none; /* Hide visual line for very small screens */
  }

  .languages-wrapper {
    padding: 32px 16px;
  }

  .lang-pills {
    gap: 10px;
  }

  .lang-pill {
    padding: 10px 20px;
    font-size: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-meta {
    justify-content: center;
  }
}
