/**
 * Responsive Styles
 * Mobile-first approach with progressive enhancement
 */

/* ========================================
   TABLET & BELOW (max-width: 1024px)
   ======================================== */

@media (max-width: 1024px) {
    :root {
        --container-width: 100%;
        --space-9xl: 6rem;
    }

    /* Hero */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6xl);
    }

    .hero-image {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-title {
        max-width: 100%;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6xl);
    }

    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4xl);
    }

    /* Approach */
    .approach-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4xl);
    }

    /* Values */
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5xl);
    }
}

/* ========================================
   MOBILE & BELOW (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
        --space-8xl: 4rem;
        --space-9xl: 5rem;
        --btn-padding-x: var(--space-3xl);
        --btn-padding-y: var(--space-xl);
        --card-padding: var(--card-padding-mobile);
    }

    .container {
        padding-left: var(--space-3xl);
        padding-right: var(--space-3xl);
    }

    /* Header */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height-mobile);
        left: 0;
        right: 0;
        background-color: var(--color-neutral-0);
        box-shadow: var(--shadow-xl);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all var(--transition-base);
        z-index: var(--z-index-dropdown);
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .main-nav .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-3xl);
    }

    .nav-link {
        padding: var(--space-3xl);
        border-bottom: var(--border-width-thin) solid var(--color-border-light);
    }

    .nav-link::after {
        display: none;
    }


    /* Hero */
    .hero {
        min-height: var(--hero-min-height-mobile);
        padding: var(--space-7xl) 0;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-4xl);
    }

    .stat {
        text-align: center;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }

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

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5xl);
    }

    /* Approach */
    .approach-card {
        padding: var(--space-5xl);
    }

    /* Values */
    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }

    /* About */
    .about-highlights {
        grid-template-columns: 1fr;
    }

    /* Credentials */
    .credentials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4xl);
    }

    /* CTA Final */
    .contact-form {
        padding: var(--space-5xl) var(--space-4xl);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-6xl);
    }

    /* Back to top */
    .back-to-top {
        bottom: var(--space-3xl);
        right: var(--space-3xl);
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 475px)
   ======================================== */

@media (max-width: 475px) {
    :root {
        --space-7xl: 3rem;
        --space-8xl: 3.5rem;
        --space-9xl: 4rem;
    }

    .container {
        padding-left: var(--space-2xl);
        padding-right: var(--space-2xl);
    }

    /* Typography */
    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .section-title,
    .section-title-white {
        font-size: var(--font-size-3xl);
    }

    /* Hero */
    .hero-badge {
        font-size: 0.7rem;
        padding: var(--space-sm) var(--space-2xl);
    }

    /* Services */
    .service-card {
        padding: var(--space-4xl);
    }

    .service-icon {
        width: 48px;
        height: 48px;
    }

    .service-icon i {
        width: 24px;
        height: 24px;
    }

    /* Approach */
    .approach-card {
        padding: var(--space-4xl);
    }

    .approach-number {
        font-size: var(--font-size-4xl);
    }

    /* Credentials */
    .credentials-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5xl);
    }

    .credential-card {
        padding: var(--space-4xl);
    }

    /* Values */
    .value-badge {
        padding: var(--space-4xl) var(--space-2xl);
    }

    /* Buttons */
    .btn-primary-large,
    .btn-secondary-large {
        padding: var(--space-2xl) var(--space-4xl);
    }

    /* Back to top */
    .back-to-top {
        bottom: var(--space-2xl);
        right: var(--space-2xl);
    }
}

/* ========================================
   LARGE SCREENS (min-width: 1536px)
   ======================================== */

@media (min-width: 1536px) {
    :root {
        --container-width: var(--container-width-2xl);
    }

    .hero-grid {
        gap: var(--space-9xl);
    }

    .about-grid {
        gap: var(--space-9xl);
    }
}

/* ========================================
   LANDSCAPE ORIENTATION FIXES
   ======================================== */

@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-6xl) 0;
    }

    .hero-stats {
        padding-top: var(--space-4xl);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .header,
    .back-to-top,
    .mobile-menu-toggle {
        display: none;
    }

    .hero {
        min-height: auto;
    }

    section {
        page-break-inside: avoid;
    }

    .btn {
        border: var(--border-width-thin) solid var(--color-neutral-800);
    }

    * {
        box-shadow: none !important;
    }
}

/* ========================================
   HOVER SUPPORT CHECK
   ======================================== */

@media (hover: none) {
    /* Disable hover effects on touch devices */
    .service-card:hover,
    .approach-card:hover,
    .value-badge:hover,
    .credential-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }

    .btn:hover {
        transform: none;
    }

    .back-to-top:hover {
        transform: translateY(0);
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-background::after {
        animation: none;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #0D47A1;
        --color-text-primary: #000000;
        --color-text-heading: #000000;
        --color-border-light: #000000;
    }

    .btn {
        border-width: var(--border-width-medium);
    }
}

/* ========================================
   FOCUS VISIBLE ENHANCEMENTS
   ======================================== */

@supports selector(:focus-visible) {
    *:focus {
        outline: none;
    }

    *:focus-visible {
        outline: var(--border-width-medium) solid var(--color-primary);
        outline-offset: 2px;
    }
}
