/* Responsive Design - Mobile First Approach */
/* Optimized for all devices and screen sizes */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 0 1rem;
    }
    
    .hero-text {
        order: 1;
    }
    
    .hero-mascot {
        order: 2;
        margin-top: 2rem;
    }
    
    .mascot-image {
        width: 250px;
        height: 250px;
    }
    
    .hero-mascot {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-mascot {
        order: 2;
        margin: 2rem 0;
    }
    
    .logo-mascot {
        width: 24px;
        height: 24px;
    }
    
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .btn-modern {
        width: 100%;
        max-width: 250px;
        justify-content: center;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .services-grid-3d {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card-3d {
        padding: 1.2rem;
    }
    
    .service-icon-3d {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .service-title-3d {
        font-size: 1.2rem;
    }
    
    .service-description-3d {
        font-size: 0.9rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .portfolio-item {
        min-height: 150px;
    }
    
    .portfolio-image-placeholder {
        height: 150px;
        font-size: 2rem;
    }
    
    .portfolio-image-placeholder span {
        font-size: 0.8rem;
    }
    
    .portfolio-overlay {
        padding: 1rem;
    }
    
    .portfolio-title {
        font-size: 1.1rem;
    }
    
    .portfolio-tech {
        font-size: 0.8rem;
    }
    
    .portfolio-features {
        gap: 0.3rem;
    }
    
    .portfolio-features .feature-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-form-3d {
        padding: 1.5rem 1rem;
    }
    
    .form-input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .nav-container {
        padding: 0.8rem 1rem;
    }
    
    .logo-3d {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 1.5rem;
        transition: left 0.3s ease;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 0.8rem 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 1rem;
    }
    
    .nav-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
    }
    
    .nav-toggle .bar {
        width: 22px;
        height: 2px;
        background: var(--primary-color);
        margin: 2px 0;
        transition: 0.3s;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-4px, 5px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-4px, -5px);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-description {
        font-size: 0.9rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tech-stack {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .tech-item {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.1rem;
    }
    
    .feature-card p {
        font-size: 0.9rem;
    }
    
    .cta-content {
        padding: 2rem 1rem;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn-modern {
        width: 100%;
        max-width: 250px;
    }
    
    /* Products Section Mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card {
        padding: 1.5rem;
    }
    
    .product-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .product-card h3 {
        font-size: 1.3rem;
    }
    
    .product-card p {
        font-size: 0.9rem;
    }
    
    /* Development Cycle Mobile */
    .cycle-timeline::before {
        left: 30px;
    }
    
    .cycle-step {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 60px;
    }
    
    .step-number {
        position: absolute;
        left: -10px;
        margin: 0;
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .step-content {
        margin-left: 0;
        width: 100%;
        padding: 2rem;
    }
    
    .step-content h3 {
        font-size: 1.5rem;
    }
    
    .step-content p {
        font-size: 1rem;
    }
    
    .step-features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .step-features li {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        width: 100%;
        max-width: 100%;
    }
    
    .services-grid-3d {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .services-grid-3d {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .nav-menu {
        display: flex;
    }
    
    .nav-toggle {
        display: none;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .services-grid-3d {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
    }
    
    .services-grid-3d {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
    }
    
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
    }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
    .hero-title {
        font-size: 6rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .services-grid-3d {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .service-icon-3d,
    .portfolio-image,
    .hero-visual {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .nav-3d,
    .hero-buttons,
    .contact-form-3d,
    .footer-3d {
        display: none;
    }
    
    .hero-3d {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title {
        color: #000;
        background: none;
        -webkit-text-fill-color: initial;
    }
    
    .card-3d {
        background: #fff;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .service-card-3d,
    .portfolio-item {
        break-inside: avoid;
    }
}

/* Accessibility - Reduced Motion */
@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;
    }
    
    .floating-element,
    .particle {
        animation: none;
    }
    
    .card-3d:hover {
        transform: none;
    }
    
    .service-card-3d:hover,
    .portfolio-item:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-muted: #666666;
    }
}

/* Light Mode Support (if needed) */
@media (prefers-color-scheme: light) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --text-muted: #666666;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-3d {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .nav-menu {
        flex-direction: row;
    }
}

/* Portrait Orientation */
@media (orientation: portrait) {
    .hero-visual {
        order: -1;
    }
    
    .about-visual {
        order: -1;
    }
}

/* Hover Support Detection */
@media (hover: none) {
    .card-3d:hover,
    .service-card-3d:hover,
    .portfolio-item:hover {
        transform: none;
        box-shadow: var(--shadow-3d);
    }
    
    .btn-modern:hover {
        transform: none;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .btn-modern {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 1rem;
    }
    
    .form-input {
        min-height: 44px;
    }
    
    .service-card-3d,
    .portfolio-item {
        cursor: pointer;
    }
}

/* Specific Device Optimizations */
/* iPhone SE and similar small screens */
@media (max-width: 375px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .service-card-3d,
    .contact-form-3d {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
}

/* iPad and similar tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        width: 100%;
        max-width: 100%;
    }
    
    .services-grid-3d {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Desktop Screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-title {
        font-size: 7rem;
    }
    
    .section-title {
        font-size: 4rem;
    }
    
    .services-grid-3d {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
