/* ============================================================================
   HERO SECTION COMPONENT

   Full-width hero banner with gradient background, animated title,
   subtitle, and call-to-action.

   Purpose: Eye-catching above-the-fold section to communicate value
   proposition and drive user engagement.

   Required HTML Structure:

   <section class="hero">
     <div class="screenshot-collage">
       <!-- Optional: Background screenshot images -->
     </div>
     <div class="container">
       <h1>
         <span class="hero-text-desktop">Your Headline for Desktop</span>
         <span class="hero-text-mobile">Shorter Mobile Headline</span>
       </h1>
       <p>Your compelling subtitle text here.</p>

       <!-- Optional: Video embed -->
       <div class="video-container">
         <!-- Video content -->
       </div>

       <!-- Optional: CTA button -->
       <div class="hero-cta">
         <a href="#" class="cta-button">Get Started</a>
       </div>
     </div>
   </section>

   Dependencies:
   - animations.css (for gradient-shift animation)
   - buttons.css (for .cta-button)
   - video.css (if using video-container)

   Accessibility:
   - Semantic <section> with <h1> for page title
   - Text has sufficient contrast against gradient background
   - Gradient text uses fallback color for older browsers

   Notes:
   - Title has animated gradient effect using gradient-shift animation
   - Screenshot collage background is optional decorative element
   - Mobile/desktop text swap at 950px breakpoint
   - Contains device-specific optimizations for popular phones
     (Note: Could be simplified to standard responsive breakpoints)
   ============================================================================ */

.hero {
  margin-top: 0;
  padding: 130px 0 100px; /* 80px + 50px = 130px to account for removed margin */
  background: transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  margin-top: 2rem;
  background: linear-gradient(
    135deg,
    var(--white) 0%,
    var(--light-blue) 50%,
    var(--sky-blue) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease infinite;
  position: relative;
  z-index: 1;
}

/* Desktop/Mobile text variants */
.hero-text-desktop {
  display: inline;
}

.hero-text-mobile {
  display: none;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.hero .container > * {
  position: relative;
  z-index: 1;
}


/* ===== Responsive Design ===== */

/* Tablet breakpoint - Keep desktop text, reduce size slightly */
@media (max-width: 950px) and (min-width: 769px) {
  .hero {
    padding: 120px 0 80px; /* Keep enough top padding to clear fixed header */
  }

  .hero h1 {
    font-size: 3rem; /* Slightly smaller than desktop 3.5rem, but larger than mobile 2rem */
    margin-top: 1rem;
  }

  .hero p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
  }
}

/* Mobile text swap - smaller screens only */
@media (max-width: 768px) {
  .hero-text-desktop {
    display: none;
  }

  .hero-text-mobile {
    display: inline;
  }

  .hero {
    padding: 40px 0 80px;
  }

  .hero h1 {
    font-size: 2rem;
    margin-top: 1rem;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
}

/* Generic mobile optimization */
@media only screen and (max-width: 768px) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 90px 0 120px; /* 80px + 10px = 90px to account for removed margin */
  }

  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0;
  }

  /* Keep all hero elements visible */
  .hero h1,
  .hero p,
  .hero .video-container,
  .hero .hero-cta {
    flex-shrink: 0;
  }

  /* Adjust video container for better mobile centering */
  .hero .video-container {
    margin: 0.5rem auto;
    width: 90%;
    max-width: 400px;
  }

  /* Ensure CTA button stays visible above Safari controls */
  .hero .hero-cta {
    margin-top: 0.5rem;
    margin-bottom: 30px;
  }
}


/* ===== Device-Specific Optimizations =====

   Note: These could be simplified to standard responsive breakpoints.
   Keeping for now as they were specifically tuned for popular devices.
   ===== */

/* iPhone 14 Pro Max, 15 Pro Max */
@media only screen and (min-device-width: 430px) and (max-device-width: 430px) and (min-device-height: 932px) and (max-device-height: 932px) and (-webkit-device-pixel-ratio: 3) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 20px 120px;
  }
  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0;
  }
  .hero .video-container {
    width: 90%;
    max-width: 400px;
    margin: 0.5rem auto;
  }
  .hero .hero-cta {
    margin-bottom: 30px;
  }
}

/* iPhone 14, 15, 14 Pro, 15 Pro */
@media only screen and (min-device-width: 390px) and (max-device-width: 393px) and (min-device-height: 844px) and (max-device-height: 852px) and (-webkit-device-pixel-ratio: 3) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 20px 120px;
  }
  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0;
  }
  .hero .video-container {
    width: 90%;
    max-width: 380px;
    margin: 0.5rem auto;
  }
  .hero .hero-cta {
    margin-bottom: 30px;
  }
}

/* iPhone 12, 13 */
@media only screen and (min-device-width: 390px) and (max-device-width: 390px) and (min-device-height: 844px) and (max-device-height: 844px) and (-webkit-device-pixel-ratio: 3) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 20px 120px;
  }
  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0;
  }
  .hero .video-container {
    width: 90%;
    max-width: 380px;
    margin: 0.5rem auto;
  }
  .hero .hero-cta {
    margin-bottom: 30px;
  }
}

/* iPhone SE, iPhone 8 */
@media only screen and (min-device-width: 375px) and (max-device-width: 375px) and (min-device-height: 667px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 20px 100px;
  }
  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0;
  }
  .hero .video-container {
    width: 90%;
    max-width: 350px;
    margin: 0.5rem auto;
  }
  .hero .hero-cta {
    margin-bottom: 30px;
  }
}

/* Samsung Galaxy S24 Ultra, Google Pixel 8 Pro */
@media only screen and (min-device-width: 412px) and (max-device-width: 412px) and (min-device-height: 915px) and (max-device-height: 915px) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 20px 120px;
  }
  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0;
  }
  .hero .video-container {
    width: 90%;
    max-width: 390px;
    margin: 0.5rem auto;
  }
  .hero .hero-cta {
    margin-bottom: 30px;
  }
}

/* Samsung Galaxy S23, S22 */
@media only screen and (min-device-width: 360px) and (max-device-width: 360px) and (min-device-height: 780px) and (max-device-height: 780px) {
  .hero {
    margin-top: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 90px 20px 120px;
  }
  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0;
  }
  .hero .video-container {
    width: 90%;
    max-width: 340px;
    margin: 0.5rem auto;
  }
  .hero .hero-cta {
    margin-bottom: 30px;
  }
}
