/* ===== RESPONSIVE DESIGN ===== */

/* Large devices (desktops, 1200px and up) */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero__title {
        font-size: 3rem;
    }
    
    .section__title {
        font-size: 2.5rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media screen and (max-width: 1023px) {
    :root {
        --h1-font-size: 2rem;
        --h2-font-size: 1.75rem;
        --h3-font-size: 1.25rem;
        --spacing-xl: 2rem;
        --spacing-xxl: 3rem;
    }
    
    .hero__container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .hero__content {
        order: 2;
    }
    
    .hero__image {
        order: 1;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .about__container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .about__image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .about__stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }
    
    .contact__container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .services__container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Testimonials */
    .testimonials__track {
        gap: var(--spacing-md);
    }
    
    .testimonial__card {
        flex: 0 0 50%;
    }
    
    .testimonial__content {
        padding: var(--spacing-lg);
    }
    
    .testimonial__avatar {
        width: 50px;
        height: 50px;
    }
    
    .testimonials__btn {
        width: 45px;
        height: 45px;
    }
    
    .footer__content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

/* Small devices (landscape phones, 576px and up) */
@media screen and (max-width: 767px) {
    :root {
        --h1-font-size: 1.75rem;
        --h2-font-size: 1.5rem;
        --h3-font-size: 1.125rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-xxl: 2.5rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    /* Navigation */
    
    /* Hero Section */
    .hero {
        padding-top: calc(var(--header-height) + var(--spacing-md));
        min-height: auto;
    }
    
    .hero__actions {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .hero__actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* About Section */
    .about__stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .stat {
        padding: var(--spacing-sm);
    }
    
    /* Services */
    .services__container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Testimonials */
    .testimonials__track {
        gap: var(--spacing-sm);
    }
    
    .testimonial__card {
        flex: 0 0 100%;
    }
    
    .testimonial__content {
        padding: var(--spacing-md);
    }
    
    .testimonial__author {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .testimonial__info {
        text-align: center;
    }
    
    .testimonial__avatar {
        width: 60px;
        height: 60px;
    }
    
    .testimonials__navigation {
        gap: var(--spacing-sm);
    }
    
    .testimonials__btn {
        width: 40px;
        height: 40px;
    }
    
    .service__card {
        padding: var(--spacing-md);
    }
    
    /* Contact */
    .contact__item {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .contact__icon {
        align-self: center;
    }
    
    .contact__form {
        padding: var(--spacing-md);
    }
    
    /* Footer */
    .footer__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .footer__social {
        justify-content: center;
    }
    
    /* Back to top */
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 45px;
        height: 45px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media screen and (max-width: 575px) {
    :root {
        --h1-font-size: 1.5rem;
        --h2-font-size: 1.25rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.25rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Navigation */
    .logo__icon img {
        width: 32px;
        height: 32px;
    }
    
    .logo__text h2 {
        font-size: 1rem;
    }
    
    .logo__text span {
        font-size: 0.75rem;
    }
    
    .nav__menu {
        width: 100%;
        right: -100%;
    }
    
    /* Hero */
    .hero__title {
        line-height: 1.3;
    }
    
    .hero__description {
        font-size: var(--small-font-size);
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--small-font-size);
    }
    
    .btn--large {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--normal-font-size);
    }
    
    /* Form */
    .form__input,
    .form__textarea {
        padding: var(--spacing-xs);
        font-size: var(--small-font-size);
    }
    
    .form__label {
        font-size: var(--small-font-size);
    }
    
    /* Contact items */
    .contact__details h3 {
        font-size: var(--normal-font-size);
    }
    
    .contact__details p {
        font-size: var(--small-font-size);
    }
    
    /* Service cards */
    .service__icon {
        width: 50px;
        height: 50px;
    }
    
    .service__title {
        font-size: var(--normal-font-size);
    }
    
    .service__description {
        font-size: var(--small-font-size);
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .nav__menu {
        height: 100vh;
        overflow-y: auto;
    }
}

/* High DPI displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .hero__image img,
    .about__image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .header,
    .nav__toggle,
    .back-to-top,
    .hero__actions,
    .contact__form {
        display: none !important;
    }
    
    .hero {
        padding-top: 0;
        min-height: auto;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }
    
    .section__title {
        color: #000;
        font-size: 18pt;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .hero__image-zoom {
        animation: fadeInOnly 0.5s ease-out forwards !important;
    }
}

@keyframes fadeInOnly {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #E2E8F0;
        --text-light: #94A3B8;
        --body-color: #0F172A;
        --container-color: #1E293B;
        --border-color: #334155;
    }
    
    .header {
        background-color: rgba(30, 41, 59, 0.95);
    }
    
    .nav__menu {
        background-color: var(--container-color);
    }
    
    .hero {
        background: linear-gradient(135deg, var(--body-color) 0%, #1E293B 100%);
    }
}

/* Focus styles for accessibility */
@media (prefers-reduced-motion: no-preference) {
    .nav__link:focus,
    .btn:focus,
    .form__input:focus,
    .form__textarea:focus,
    .back-to-top:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav__link {
        padding: var(--spacing-sm);
        margin: var(--spacing-xs) 0;
    }
    
    .social__link {
        min-width: 44px;
        min-height: 44px;
    }
    
    .back-to-top {
        width: 50px;
        height: 50px;
    }
    
    .service__card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}