/**
 * RESPONSIVE STYLES
 *
 * Mobile-first responsive design with breakpoints:
 * - Mobile (≤767px): Touch-optimized layouts, carousel view
 * - Tablet (768px+): Intermediate layouts, grid adjustments
 * - Desktop (1024px+): Full-width layouts, hover effects
 */

/* Responsive Design - Mobile First */

/* Mobile Styles (767px and below) */
@media (max-width: 767px) {
  .content {
    text-align: center;
  }

  body::before {
    opacity: 0; /* disable the subtle grid overlay background for MOBILE VIEW only */
  }

  .hero p {
    height: 6rem; /* Increased from 4.8rem to accommodate larger text */
    white-space: normal;
    overflow: visible;
    text-align: center;
  }

  .territory-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
  }

  .animated-phone-container {
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    /* Removed drop-shadow to avoid flash on slide change */
    filter: none;
  }

  .animated-phone {
    width: 35vw;
    max-width: 140px;
    aspect-ratio: 117 / 241;
    margin: 0 0 0 1rem; /* Give more breathing room on the left */
    filter: none; /* Remove extra shadow that can flash */
  }

  .features-list {
    margin-top: 1rem;
    width: 55vw;
    max-width: 40vw;
    min-height: 4rem;
    flex-shrink: 0;
  }

  .feature-item {
    font-size: 1rem;
    padding-left: 0;
    margin-bottom: 0;
  }

  .feature-item::before {
    content: none;
  }

  .card {
    background-size: 180% 200%; /* width fits; height is 200% so each card sees half */
  }

  .card.card-3 {
    padding-top: 5rem !important;
    padding-bottom: 1.5rem !important;
  }

  /* Scroll screen mobile adjustments */
  .scroll-screen {
    width: 120vw !important; /* enlarge on small screens to push visible area up */
  }

  .hero .typewriter-text.gradient {
    margin-bottom: 1.5rem; /* Mobile-only margin for gradient text */
  }

  .hero .typewriter-text {
    font-size: 1.25em; /* Slightly smaller font size on mobile */
  }

  .cta-container {
    margin-bottom: 2.7rem !important; /* Mobile-specific margin */
    max-width: 32rem !important; /* Mobile-specific width */
  }

  .cta-button {
    max-width: 32rem !important; /* Mobile-specific width */
  }

  /* Raise phone screenshots on mobile (ensure override over base rule) */
  .card .phone .phone-inner .phone-image {
    transform: scale(1.1) translateY(5px) !important;
  }

  /* Tutorial content mobile adjustments */
  .card-2 .tutorial-content {
    position: relative;
    min-height: 100vh;
  }

  .video-popup-overlay {
    display: none !important;
  }

  .video-grid {
    display: none;
  }

  /* Small screens (iPhone SE, etc.) - prevent header cutoff */
  .mobile-carousel .video-container {
    max-height: 85vh;
  }
}

/* Smaller mobile screens */
@media (max-width: 767px) and (max-height: 667px) {
  .mobile-carousel .video-container {
    max-height: 85vh;
  }
}

/* Larger mobile screens (iPhone 14 Pro Max, etc.) */
@media (max-width: 767px) and (min-height: 800px) {
  .mobile-carousel {
    height: 70vh !important;
  }

  .mobile-carousel .video-container {
    max-width: min(380px, 90vw);
    padding: 40px 30px 75px 30px;
    max-height: 85vh;
  }

  .mobile-carousel .tutorial-video {
    max-height: 52vh !important;
  }

  .mobile-carousel .video-slide h2 {
    font-size: 1.3rem !important;
  }
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
  .content {
    max-width: 60rem;
  }

  .hero h1 {
    font-size: 2.5rem;
    text-align: center;
  }

  .hero {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 72rem;
  }

  .hero p {
    white-space: nowrap;
    height: 3.2rem;
    overflow: hidden;
  }

  .app-preview {
    margin-bottom: 3rem;
    max-width: 44rem;
    padding: 0 3rem;
  }

  .phone-1,
  .phone-5 {
    width: 5rem;
    height: 10rem;
  }

  .phone-2,
  .phone-4 {
    width: 5.5rem;
    height: 11rem;
  }

  .phone-3 {
    width: 6rem;
    height: 12rem;
  }

  .app-buttons {
    margin-bottom: 3rem;
    max-width: 40rem;
  }

  .button-grid {
    gap: 1.5rem;
  }

  .app-store-btn {
    padding: 1.5rem;
    min-height: 6rem;
  }

  .app-store-btn img {
    width: 2.5rem;
    height: 2.5rem;
  }

  .app-store-btn .title {
    font-size: 1rem;
  }

  .app-store-btn .subtitle {
    font-size: 0.875rem;
  }

  .animated-phone-container {
    height: 228px;
    gap: 4rem;
  }

  .animated-phone {
    width: 130px;
    height: 267px;
    margin-left: 3rem;
  }

  .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .hero .typewriter-text {
    font-size: 1.2em; /* larger on bigger screens */
  }

  .tutorial-title {
    font-size: 2.5rem;
  }
  .tutorial-subtitle {
    font-size: 1.2em;
  }

  /* Desktop Grid Layout */
  .desktop-only {
    display: block;
  }

  .mobile-carousel,
  .carousel-controls,
  .action-buttons {
    display: none;
  }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
  .hero h1 {
    font-size: 3rem;
  }

  .content {
    max-width: 72rem;
  }

  .hero {
    max-width: 80rem;
  }

  .app-preview {
    max-width: 52rem;
    padding: 0 4rem;
  }

  .app-buttons {
    max-width: 48rem;
  }

  .animated-phone-container {
    height: 247px;
  }

  .tutorial-title {
    font-size: 3rem;
  }
}