/* ============================================
   CIPHER DIGITAL - Responsive Styles
   ============================================ */

/* ============================================
   Extra Large Screens (1400px+)
   ============================================ */
@media (min-width: 1400px) {
    :root {
        --container-max: 1400px;
    }

    .hero-title {
        font-size: 5rem;
    }
}

/* ============================================
   Large Screens (1200px - 1399px)
   ============================================ */
@media (max-width: 1399px) {
    :root {
        --container-max: 1200px;
    }

    .hero-title {
        font-size: 4rem;
    }
}

/* ============================================
   Desktop (992px - 1199px)
   ============================================ */
@media (max-width: 1199px) {
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-2xl);
    }

    .hero-title {
        font-size: 3.5rem;
    }

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

    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Tablet Landscape (768px - 991px)
   ============================================ */
@media (max-width: 991px) {
    :root {
        --container-padding: var(--space-4);
    }

    .section {
        padding: var(--space-16) 0;
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    /* Navigation - Premium Glassmorphism Side Drawer */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(10, 14, 39, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: var(--space-20) var(--space-8);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: var(--z-modal);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6),
            inset 1px 0 0 rgba(255, 255, 255, 0.05);
        border-left: 1px solid rgba(0, 212, 255, 0.2);
        will-change: right;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--gradient-primary);
    }

    .nav-link {
        font-size: var(--text-xl);
        padding: var(--space-5) 0;
        width: 100%;
        opacity: 1;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: all 0.3s ease;
    }

    .nav-link:hover {
        padding-left: var(--space-4);
        color: var(--primary);
    }

    .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: flex !important;
        z-index: 9999;
    }

    /* Grid adjustments */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About section */
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-image {
        max-width: 400px;
        margin: 0 auto var(--space-8);
    }

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

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

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

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

    .pricing-card.featured {
        transform: scale(1);
    }

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

    /* Process */
    .process-timeline {
        padding-left: var(--space-8);
    }

    .process-timeline::before {
        left: 0;
    }

    /* Testimonials */
    .testimonial-card {
        padding: var(--space-6);
    }

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

    /* Hide custom cursor on touch devices */
    .cursor,
    .cursor-dot {
        display: none;
    }
}

/* ============================================
   Tablet Portrait (576px - 767px)
   ============================================ */
@media (max-width: 767px) {
    :root {
        --space-section: var(--space-12);
    }

    h1 {
        font-size: var(--text-2xl);
    }

    h2 {
        font-size: var(--text-xl);
    }

    h3 {
        font-size: var(--text-lg);
    }

    .hero {
        min-height: 100vh;
        padding-top: 100px;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
        letter-spacing: -0.02em;
    }

    .hero-subtitle {
        font-size: 1.125rem;
        line-height: 1.6;
        opacity: 0.9;
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--space-4);
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        /* Larger touch targets */
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: var(--space-4);
    }

    .section-header {
        margin-bottom: var(--space-12);
    }

    /* Grid to single column */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        text-align: center;
    }

    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-filters {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-4);
    }

    /* Pricing */
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .pricing-toggle {
        flex-direction: column;
        gap: var(--space-2);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .stat-item {
        padding: var(--space-6);
    }

    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto;
    }

    /* Testimonials */
    .testimonials-slider {
        padding: 0;
    }

    .testimonial-card {
        padding: var(--space-6);
    }

    .testimonial-content {
        font-size: var(--text-base);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        order: 2;
        margin-top: var(--space-8);
    }

    /* FAQ */
    .faq-item {
        padding: var(--space-4);
    }

    .faq-question {
        font-size: var(--text-base);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        margin-bottom: var(--space-8);
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    /* Process timeline */
    .process-item {
        padding-left: var(--space-6);
    }

    /* Flip cards - disable on mobile */
    .flip-card {
        height: auto;
    }

    .flip-card-inner {
        transform: none !important;
    }

    .flip-card-back {
        position: relative;
        transform: none;
        margin-top: var(--space-4);
    }

    .flip-card-front,
    .flip-card-back {
        position: relative;
        backface-visibility: visible;
    }
}

/* ============================================
   Mobile (up to 575px) - Premium Glassmorphism
   ============================================ */
@media (max-width: 575px) {
    :root {
        --container-padding: var(--space-5);
    }

    body {
        font-size: 15px;
        background: linear-gradient(180deg, #0a0e27 0%, #0f172a 50%, #0a0e27 100%);
    }

    /* Premium Mobile Typography */
    .hero-title {
        font-size: 2rem;
        line-height: 1.15;
        letter-spacing: -0.02em;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.7;
        opacity: 0.85;
    }

    .section {
        padding: 5rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: var(--space-4);
    }

    .section-description {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .navbar {
        padding: 1rem 0;
        background: linear-gradient(180deg, rgba(10, 14, 39, 0.95) 0%, rgba(10, 14, 39, 0.8) 100%);
    }

    /* Premium Glassmorphism Cards */
    .card,
    .service-card,
    .project-card,
    .pricing-card,
    .testimonial-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .stat-item {
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(124, 58, 237, 0.05) 100%);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(0, 212, 255, 0.15);
        border-radius: 16px;
        padding: var(--space-6);
    }

    /* Premium Buttons */
    .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
    }

    .btn-primary {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        position: relative;
        overflow: hidden;
    }

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }

    /* Hero Badge - Glassmorphism */
    .hero-badge {
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 212, 255, 0.25);
        border-radius: 50px;
        padding: 0.75rem 1.25rem;
    }

    /* Trust Bar - Enhanced */
    .trust-bar {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: var(--space-5) 0;
    }

    .tech-badge {
        padding: var(--space-2) var(--space-3);
        font-size: 0.75rem;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 20px;
    }

    /* Stats Enhancement */
    .stat-number {
        font-size: 2.25rem !important;
    }

    .stat-label {
        font-size: var(--text-sm);
        line-height: 1.5;
    }

    /* Counter */
    .counter {
        font-size: var(--text-3xl);
    }

    /* Pricing Enhancement */
    .pricing-card {
        background: linear-gradient(145deg, rgba(15, 23, 42, 0.9) 0%, rgba(10, 14, 39, 0.95) 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .pricing-card.featured {
        border-color: var(--primary);
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.15);
    }

    .pricing-price {
        font-size: var(--text-3xl);
    }

    /* Testimonial Enhancement */
    .testimonial-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    }

    .testimonial-content {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    .testimonial-rating {
        color: #fbbf24;
        letter-spacing: 2px;
    }

    /* Portfolio Enhancement */
    .portfolio-item {
        border-radius: 16px;
        overflow: hidden;
    }

    .portfolio-overlay {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }

    .portfolio-result {
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }

    /* Tech stack */
    .tech-item {
        width: 50px;
        height: 50px;
        font-size: var(--text-xl);
    }

    /* Blog */
    .blog-meta {
        flex-direction: column;
        gap: var(--space-2);
    }

    /* Contact form - Glassmorphism */
    .contact-form-wrapper {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 20px;
        padding: var(--space-6);
    }

    .input-field {
        padding: var(--space-4);
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        font-size: 1rem;
    }

    .input-field:focus {
        border-color: var(--primary);
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.15);
    }

    /* FAQ Enhancement */
    .faq-item {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        margin-bottom: var(--space-3);
    }

    /* Scroll to top - Glassmorphism */
    .scroll-top {
        width: 44px;
        height: 44px;
        right: var(--space-4);
        bottom: calc(var(--space-4) + 70px);
        /* Above sticky CTA */
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Footer Enhancement */
    .footer {
        background: linear-gradient(180deg, rgba(10, 14, 39, 1) 0%, rgba(5, 7, 20, 1) 100%);
    }
}

/* ============================================
   Small Mobile (up to 375px)
   ============================================ */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.625rem;
    }

    .section-title {
        font-size: var(--text-lg);
    }

    .nav-menu {
        padding: var(--space-16) var(--space-4);
    }
}

/* ============================================
   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;
    }

    .parallax-layer {
        transform: none !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --primary: #00ffff;
        --secondary: #ff00ff;
        --accent: #ff0000;
    }

    .glass,
    .card-glass {
        background: var(--primary-dark);
        border: 2px solid var(--white);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .navbar,
    .scroll-top,
    .cursor,
    .cursor-dot,
    #particles-js,
    .scroll-progress {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ============================================
   Landscape Mode Adjustments
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-16) 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        display: none;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {

    /* Disable hover effects on touch devices */
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-glow:hover,
    .hover-rotate:hover {
        transform: none;
        box-shadow: none;
    }

    .card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Make touch targets larger */
    .nav-link,
    .filter-btn,
    .accordion-header {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Disable custom cursor */
    .cursor,
    .cursor-dot {
        display: none !important;
    }
}

/* ============================================
   Dark Mode Support (Already default)
   ============================================ */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as it's the brand identity */
    /* Users can add a light mode toggle in JS */
}