/* Critical CSS - Above the fold styles for fastest loading */

/* CSS Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Design System Variables */
:root {
    /* Colors */
    --primary-blue: #1E3A8A;
    --secondary-gray: #64748B;
    --accent-gold: #F59E0B;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --background-light: #F9FAFB;
    --border-color: #E5E7EB;
    --white: #FFFFFF;
    --black: #000000;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, #3B82F6 100%);
    --gradient-hero: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(59, 130, 246, 0.8) 100%);
    --gradient-accent: linear-gradient(45deg, var(--accent-gold) 0%, #FCD34D 100%);
    
    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Font Sizes - Fluid Typography */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --font-size-3xl: clamp(2rem, 1.7rem + 1.5vw, 3rem);
    --font-size-4xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing - Consistent Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* Container */
    --container-max-width: 1280px;
    --container-padding: var(--space-6);
}

/* Base HTML Elements */
html {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: var(--leading-normal);
    color: var(--text-dark);
    background-color: var(--white);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    font-size: var(--font-size-base);
    line-height: var(--leading-normal);
    color: var(--text-dark);
    background-color: var(--white);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: var(--white);
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Force all sections and elements to be static - no animations */
section,
.section-header,
.section-title,
.section-subtitle,
.service-card,
.testimonial,
.contact-card,
.about__visual {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    position: static !important;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Header & Navigation - Critical */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-fixed);
    transition: var(--transition-base);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: var(--font-weight-bold);
    transition: var(--transition-fast);
}

.nav__logo:hover {
    color: var(--primary-blue);
}

.nav__logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.nav__logo-text {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.nav__link {
    position: relative;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    color: var(--text-dark);
    text-decoration: none;
    padding: var(--space-2) 0;
    transition: var(--transition-fast);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: var(--transition-fast);
}

.nav__link:hover,
.nav__link.active {
    color: var(--primary-blue);
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

.nav__cta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.nav__toggle-icon {
    width: 100%;
    height: 2px;
    background: var(--text-dark);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

/* Button System - Critical */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    line-height: var(--leading-tight);
    text-decoration: none;
    text-align: center;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.btn--primary {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--space-3) var(--space-6);
    box-shadow: var(--shadow-md);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: var(--white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: calc(var(--space-3) - 2px) calc(var(--space-6) - 2px);
}

.btn--secondary:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-1px);
}

.btn--outline {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: calc(var(--space-3) - 1px) calc(var(--space-6) - 1px);
}

.btn--outline:hover {
    background: var(--background-light);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn--whatsapp {
    background: #25D366;
    color: var(--white);
    border: none;
    padding: var(--space-3) var(--space-6);
    box-shadow: var(--shadow-md);
}

.btn--whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn--whatsapp:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn--large {
    font-size: var(--font-size-base);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-xl);
}

.btn--small {
    font-size: var(--font-size-xs);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
}

/* Hero Section - Critical Above the Fold */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    overflow: hidden;
    z-index: 100;
    isolation: isolate;
}

.hero::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to bottom, rgba(30, 58, 138, 0.1), transparent);
    z-index: 101;
    pointer-events: none;
}

/* Force proper document flow */
.hero + * {
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
}

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
    z-index: -1;
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-20) 0;
}

.hero__title {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-4xl);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-6);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero__title-main {
    display: block;
    color: var(--white);
}

.hero__title-sub {
    display: block;
    color: var(--white);
}

.hero__title-accent {
    display: block;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent-gold);
}

.hero__description {
    font-size: var(--font-size-lg);
    line-height: var(--leading-relaxed);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-8);
    max-width: 600px;
}

.hero__stats {
    display: flex;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
    flex-wrap: wrap;
    justify-content: center;
}

.hero__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero__stat-number {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xl);
    color: var(--accent-gold);
    margin-bottom: var(--space-1);
}

.hero__stat-label {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero__cta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    justify-content: center;
}

.hero__scroll {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.hero__scroll-indicator {
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.5);
    position: relative;
    border-radius: var(--radius-full);
}

.hero__scroll-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--white);
    border-radius: var(--radius-full);
    animation: scroll-indicator 2s ease-in-out infinite;
}

@keyframes scroll-indicator {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    transition: opacity var(--transition-base);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner-large {
    margin-bottom: var(--space-4);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    font-weight: var(--font-weight-medium);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Navigation - Critical for Mobile */
@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: var(--space-12);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        box-shadow: var(--shadow-xl);
    }
    
    .nav__menu.active {
        transform: translateX(0);
    }
    
    .nav__list {
        flex-direction: column;
        gap: var(--space-8);
    }
    
    .nav__link {
        font-size: var(--font-size-lg);
        padding: var(--space-3) var(--space-6);
    }
    
    .nav__cta {
        margin-top: var(--space-8);
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .nav__toggle {
        display: flex;
    }
    
    .nav__toggle.active .nav__toggle-icon:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav__toggle.active .nav__toggle-icon:nth-child(2) {
        opacity: 0;
    }
    
    .nav__toggle.active .nav__toggle-icon:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Hero Mobile Adjustments */
    .hero__content {
        padding: var(--space-16) 0;
    }
    
    .hero__title {
        font-size: var(--font-size-3xl);
    }
    
    .hero__stats {
        gap: var(--space-4);
    }
    
    .hero__cta {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .btn--large {
        width: 100%;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-light: #000000;
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }
}

/* Print Styles */
@media print {
    .nav,
    .hero__scroll,
    .back-to-top,
    .loading-overlay {
        display: none !important;
    }
    
    .hero {
        min-height: 60vh;
        padding: var(--space-8) 0;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000000;
        background: #ffffff;
    }
}

/* Focus Styles for Better Accessibility */
*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}