/* ========================================
   RESPONSIVE TYPOGRAPHY & SIZING
   Mobile-first approach with proper text sizing
   NO word-breaking, only size adjustments
======================================== */

/* ========================================
   BREAKPOINT REFERENCE
   - 280px: Galaxy Fold, extremely narrow
   - 320px: iPhone SE, older devices  
   - 400px: Small phones
   - 768px: Tablets
   - 1050px: Desktop/Mobile menu switch
   - 1200px: Large desktop
======================================== */

/* Base responsive font sizing */
html {
    font-size: 16px;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all elements respect container bounds */
* {
    box-sizing: border-box;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* ========================================
   SMALL SCREENS (400px and below)
======================================== */
@media (max-width: 400px) {
    /* Ensure containers are properly constrained */
    .container,
    .hero-content,
    .hero-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }
    
    /* Hero section */
    .hero-title {
        font-size: 2rem !important;
        letter-spacing: 0.05rem !important;
        padding: 0 !important;
        line-height: 1.2;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
        letter-spacing: 0.02rem !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .hero-buttons {
        gap: 0.5rem;
        padding: 0 !important;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.75rem !important;
        letter-spacing: 0.08rem !important;
        padding: 0 0.5rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem !important;
        padding: 0 0.5rem;
    }
    
    /* Service cards */
    .service-title {
        font-size: 1.1rem !important;
        letter-spacing: 0.05rem !important;
    }
    
    .service-description {
        font-size: 0.85rem !important;
        line-height: 1.4;
    }
    
    /* About section stats */
    .stat-number {
        font-size: 2rem !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
    }
    
    /* Contact section */
    .contact-subtitle {
        font-size: 1rem !important;
        padding: 0 0.5rem;
    }
    
    /* Footer */
    .footer-title {
        font-size: 1rem !important;
        letter-spacing: 0.08rem !important;
    }
    
    .footer-subtitle {
        font-size: 0.9rem !important;
        letter-spacing: 0.05rem !important;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.85rem !important;
        padding: 0.6rem 1.2rem !important;
        letter-spacing: 0.05rem !important;
    }
    
    /* Review cards */
    .review-text {
        font-size: 0.9rem !important;
        line-height: 1.5;
    }
    
    .author-name {
        font-size: 0.95rem !important;
    }
}

/* ========================================
   EXTRA SMALL SCREENS (320px and below)
======================================== */
@media (max-width: 320px) {
    /* Tighter constraints for very small screens */
    .container,
    .hero-content,
    .hero-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
        letter-spacing: 0.03rem !important;
        padding: 0 !important;
        line-height: 1.15;
    }
    
    .hero-subtitle {
        font-size: 0.8rem !important;
        letter-spacing: 0.01rem !important;
        padding: 0 !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
        letter-spacing: 0.05rem !important;
        margin-bottom: 0.75rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem !important;
    }
    
    .service-title {
        font-size: 1rem !important;
        letter-spacing: 0.03rem !important;
    }
    
    .service-description {
        font-size: 0.8rem !important;
    }
    
    .stat-number {
        font-size: 1.75rem !important;
    }
    
    .stat-label {
        font-size: 0.75rem !important;
    }
    
    .btn {
        font-size: 0.8rem !important;
        padding: 0.5rem 1rem !important;
        letter-spacing: 0.03rem !important;
    }
    
    .footer-title {
        font-size: 0.9rem !important;
    }
    
    .footer-subtitle {
        font-size: 0.85rem !important;
    }
    
    /* Ensure containers have padding */
    .container {
        padding: 0 0.75rem !important;
    }
    
    .hero-content,
    .about-content,
    .services-grid,
    .contact-content {
        padding: 0 0.5rem !important;
    }
}

/* ========================================
   ULTRA SMALL SCREENS (280px and below)
======================================== */
@media (max-width: 280px) {
    /* Maximum constraints for ultra-narrow screens */
    .container,
    .hero-content,
    .hero-container {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .hero-title {
        font-size: 1.25rem !important;
        letter-spacing: 0.02rem !important;
        padding: 0 !important;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.75rem !important;
        letter-spacing: 0.01rem !important;
        padding: 0 !important;
    }
    
    .section-title {
        font-size: 1.25rem !important;
        letter-spacing: 0.03rem !important;
    }
    
    .service-title {
        font-size: 0.9rem !important;
    }
    
    .btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.8rem !important;
    }
    
    /* Stack buttons vertically */
    .hero-buttons {
        gap: 0.5rem;
        flex-direction: column;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
    }
}

/* ========================================
   UTILITY CLASSES
======================================== */

/* Prevent text overflow */
.text-responsive {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Container padding adjustments */
@media (max-width: 480px) {
    .hero-section,
    .about-section,
    .services-section,
    .contact-section,
    .reviews-section,
    .team-section {
        padding: 40px 0 !important;
    }
}

@media (max-width: 320px) {
    .hero-section,
    .about-section,
    .services-section,
    .contact-section,
    .reviews-section,
    .team-section {
        padding: 30px 0 !important;
    }
}
