/* ========================================
   SMART CODING - Responsive Stylesheet
   ======================================== */

/* -------- Tablet (max-width: 1024px) -------- */
@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
    }

    .nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 24px;
        gap: 0;
        border-top: 1px solid var(--border-color);
    }

    .nav.active {
        display: flex;
    }

    .nav-link {
        display: block;
        padding: 16px 0;
        font-size: 1.25rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link::after {
        display: none;
    }

    .header-actions {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-title {
        font-size: clamp(2.2rem, 7vw, 4rem);
    }

    .hero-stats {
        gap: 40px;
    }

    /* Hero Split Layout - Stack on Tablet */
    .hero-container {
        display: flex !important;
        /* Force override */
        flex-direction: column-reverse !important;
        /* Image on top, text on bottom if desired, or column for standard order */
        /* Let's stick to column but ensure sizing */
        flex-direction: column !important;
        align-items: stretch !important;
        /* Let children take full width */
        justify-content: center;
        text-align: center;
    }

    .hero-text {
        width: 100% !important;
        /* Ensure it takes full width */
        max-width: 100%;
        padding: 0 24px !important;
        /* Force reset padding */
        box-sizing: border-box;
        /* Reset header padding for mobile */
    }

    .hero-title,
    .hero-description {
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .stat {
        text-align: center;
    }

    /* Hero Carousel - Tablet Responsive */
    .hero-carousel {
        max-width: 100%;
        min-width: unset;
        width: 100%;
        margin-right: 0;
        margin-top: 40px;
        perspective: 800px;
        animation: heroImageRevealTablet 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
    }

    @keyframes heroImageRevealTablet {
        0% {
            opacity: 0;
            transform: translateY(60px) scale(0.95);
            filter: blur(8px);
        }

        60% {
            filter: blur(0px);
        }

        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }
    }

    .carousel-container {
        filter:
            drop-shadow(0 20px 60px rgba(84, 104, 255, 0.3)) drop-shadow(0 8px 25px rgba(0, 0, 0, 0.35));
    }

    .carousel-container:hover {
        transform: none;
        /* Disable 3D tilt on tablet */
    }

    .carousel-track {
        min-height: 350px;
        max-height: 420px;
        aspect-ratio: 16/10;
    }

    .carousel-indicators {
        bottom: -35px;
        gap: 10px;
        padding: 10px 18px;
    }

    .indicator {
        width: 32px;
        height: 4px;
    }

    /* Show caption by default on tablet */
    .slide-caption {
        opacity: 1;
        transform: translateY(0);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-brand {
        grid-column: span 2;
    }
}

/* -------- Mobile Large (max-width: 768px) -------- */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .hero {
        padding-top: calc(var(--header-height) + 60px);
        padding-bottom: 60px;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 12px;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .hero-scroll {
        display: none;
    }

    .clients {
        padding: 40px 0;
    }

    .clients-title {
        font-size: 0.8rem;
    }

    .services,
    .projects,
    .technologies,
    .testimonials,
    .about,
    .contact {
        padding: 80px 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 32px 24px;
    }

    .projects-filter {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card .stat-number {
        font-size: 2.25rem;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        padding: 32px 24px;
    }

    .cta-section {
        padding: 80px 0;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .contact-form-container {
        padding: 32px 24px;
    }

    .footer {
        padding: 60px 0 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* -------- Mobile Small (max-width: 480px) -------- */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .section-tag {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .service-icon {
        width: 56px;
        height: 56px;
    }

    .service-title {
        font-size: 1.25rem;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .tech-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .ceo-card {
        padding: 24px;
    }

    .ceo-image {
        width: 100px;
        height: 100px;
    }

    .ceo-name {
        font-size: 1.25rem;
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
    }

    .contact-item .contact-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .footer-social .social-link {
        width: 36px;
        height: 36px;
    }
}

/* -------- Landscape Mobile -------- */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + 40px) 24px 60px;
    }

    .hero-stats {
        display: none;
    }

    .hero-scroll {
        display: none;
    }
}

/* -------- Print Styles -------- */
@media print {

    .header,
    .hero-bg,
    .hero-scroll,
    .menu-toggle,
    .btn,
    .cta-section,
    .contact-form-container {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .section-title,
    .gradient-text {
        background: none;
        -webkit-text-fill-color: black;
        color: black;
    }
}

/* -------- Reduced Motion -------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* -------- High Contrast -------- */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --text-secondary: #d0d0d0;
        --text-muted: #b0b0b0;
    }

    .btn-outline {
        border-width: 2px;
    }
}

/* -------- Dark Mode Override (for system preference) -------- */
@media (prefers-color-scheme: light) {
    /* Keep dark mode - this is intentional */
    /* The site is designed for dark mode */
}