/* ===================================================================
   RESPONSIVE DESIGN - Mobile & Tablet Optimizations
   =================================================================== */

/* --- Tablets and Below (≤1024px) --- */
@media (max-width: 1024px) {

    /* Navigation Adjustments */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 100px 30px 30px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2050;
        overflow-y: auto;
        /* Performance optimizations */
        will-change: transform;
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-link {
        display: block;
        padding: 15px 10px;
        color: var(--text-color);
        font-size: 1.1rem;
        /* Touch target optimization */
        min-height: 44px;
    }

    .nav-link::after {
        background: var(--secondary-color);
    }

    /* Logo size reduction */
    .logo img {
        width: 55px;
        height: 55px;
    }

    .logo-text h1 {
        font-size: 1.3rem;
    }

    .logo-text p {
        font-size: 0.65rem;
    }

    /* Hero Section */
    .hero-main-title {
        font-size: 2.5rem;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }

    .hero-buttons {
        flex-wrap: wrap;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    /* Section Spacing */
    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2.5rem;
    }

    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Expertise Grid */
    .expertise-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    /* Portfolio Filters */
    .portfolio-filters {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 0.9rem;
    }

    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    /* Contact Content */
    .contact-content {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* --- Mobile Devices (≤768px) --- */
@media (max-width: 768px) {

    /* Container Padding */
    .container {
        padding: 0 15px;
    }

    /* Navigation */
    .navbar .container {
        padding: 0 15px;
    }

    .nav-menu {
        max-width: 100%;
        padding: 90px 20px 20px;
    }

    .logo {
        gap: 10px;
    }

    .logo img {
        width: 50px;
        height: 50px;
    }

    .logo-text h1 {
        font-size: 1.1rem;
    }

    .logo-text p {
        font-size: 0.55rem;
        padding-left: 10px;
    }

    /* Hero Section */
    .hero-content {
        bottom: 40px;
        left: 30px;
    }

    .hero-main-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Watermark - Reduce size on mobile */
    .watermark {
        font-size: 12vw;
        letter-spacing: 1rem;
    }

    /* Stats Section */
    .stats-section {
        padding: 40px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .stat-number {
        font-size: 3rem;
    }

    /* Section Headers */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* About Section */
    .about-image img {
        max-width: 100%;
        height: auto;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    /* Expertise Section */
    .expertise-grid {
        grid-template-columns: 1fr;
    }

    .expertise-capabilities {
        padding: 30px 20px;
    }

    .capabilities-list {
        grid-template-columns: 1fr;
    }

    /* Portfolio Section */
    .portfolio-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        width: 100%;
        text-align: center;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* Insights Grid */
    .insights-grid {
        grid-template-columns: 1fr;
    }

    /* Career Section */
    .career-content {
        grid-template-columns: 1fr;
    }

    .opening-list {
        grid-template-columns: 1fr;
    }

    /* Contact Section */
    .contact-info {
        gap: 30px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    /* Social Icons */
    .social-icons-band {
        gap: 20px;
    }

    .social-icons-band a {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    /* QR Grid */
    .qr-grid-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .qr-item-main {
        padding: 20px;
    }

    .qr-item-main img {
        width: 120px;
        height: 120px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Lightbox */
    .lightbox-content {
        max-width: 95%;
        max-height: 80vh;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 30px 20px;
    }
}

/* --- Small Mobile Devices (≤480px) --- */
@media (max-width: 480px) {

    /* Typography */
    .hero-main-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* Logo */
    .logo img {
        width: 45px;
        height: 45px;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .logo-text p {
        display: none;
        /* Hide subtitle on very small screens */
    }

    /* Stats */
    .stat-number {
        font-size: 2.5rem;
    }

    .stat-item i {
        font-size: 2rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    /* QR Grid - Single column */
    .qr-grid-main {
        grid-template-columns: 1fr;
    }

    /* Footer Social */
    .footer-social {
        gap: 15px;
    }

    /* Theme Switcher - Adjust for small screens */
    .theme-switcher-col {
        gap: 10px;
    }

    .theme-switcher-col .theme-btn {
        width: 30px;
        height: 30px;
    }
}

/* --- Performance Optimizations --- */

/* Hardware Acceleration for Animations */
.nav-menu,
.nav-toggle span,
.portfolio-item,
.expertise-card,
.hero-slide,
.modal,
.lightbox {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Smooth Scrolling with GPU Acceleration */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Optimize for touch devices */
    .nav-link,
    .btn,
    .filter-btn,
    .hero-nav-dot {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .portfolio-item:hover .portfolio-image img,
    .expertise-card:hover {
        transform: none;
    }

    /* Larger tap targets */
    .back-to-top {
        width: 50px;
        height: 50px;
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
    }

    .hero-main-title {
        font-size: 1.8rem;
    }

    .hero-tagline {
        font-size: 0.9rem;
    }

    .nav-menu {
        padding: 80px 20px 20px;
    }
}