/**
 * AURORA X - Responsive Stylesheet
 * Version: 1.0
 * Author: CleanWebThemes
 * 
 * Breakpoints:
 * - sm: 640px
 * - md: 768px
 * - lg: 1024px
 * - xl: 1280px
 * - 2xl: 1536px
 */

/* ==========================================================================
   Extra Large Screens (1280px and below)
   ========================================================================== */

@media (max-width: 1280px) {
    .container {
        max-width: 1024px;
    }
    
    .hero-inner {
        gap: var(--spacing-3xl);
    }
    
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
        gap: var(--spacing-2xl);
    }
    
    .stats-grid {
        gap: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

/* ==========================================================================
   Large Screens (1024px and below)
   ========================================================================== */

@media (max-width: 1024px) {
    .container {
        max-width: 768px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding: var(--spacing-3xl);
        gap: var(--spacing-lg);
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: var(--shadow-xl);
        z-index: var(--z-modal);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 1.25rem;
    }
    
    .nav-dropdown {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        padding-left: var(--spacing-lg);
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-item.open .nav-dropdown {
        max-height: 500px;
    }
    
    .menu-toggle {
        display: flex;
        z-index: calc(var(--z-modal) + 1);
    }
    
    /* Mobile Menu Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-base);
        z-index: calc(var(--z-modal) - 1);
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hero */
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-visual {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero-float {
        display: none;
    }
    
    /* Grids */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .masonry-grid {
        columns: 2;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
    
    .footer-brand {
        grid-column: span 2;
        max-width: 100%;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* CTA */
    .cta-section {
        padding: var(--spacing-3xl);
    }
}

/* ==========================================================================
   Medium Screens (768px and below)
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --spacing-4xl: 4rem;
        --spacing-3xl: 3rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Typography */
    .display-1 {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .display-2 {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding: 120px 0 var(--spacing-4xl);
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    /* Buttons */
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Grids */
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-item {
        aspect-ratio: 16/10;
    }
    
    .portfolio-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    }
    
    /* Masonry */
    .masonry-grid {
        columns: 1;
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stat-item {
        padding: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* CTA */
    .cta-section {
        padding: var(--spacing-2xl);
        border-radius: var(--radius-lg);
    }
    
    /* Cards */
    .card-body {
        padding: var(--spacing-lg);
    }
    
    .service-card {
        padding: var(--spacing-xl);
    }
    
    /* Section */
    .section {
        padding: var(--spacing-3xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* Lead */
    .lead {
        font-size: 1.125rem;
    }
    
    /* Blockquote */
    blockquote, .blockquote {
        padding: var(--spacing-lg);
        font-size: 1.125rem;
    }
    
    blockquote::before {
        font-size: 3rem;
        top: var(--spacing-sm);
        left: var(--spacing-md);
    }
}

/* ==========================================================================
   Small Screens (640px and below)
   ========================================================================== */

@media (max-width: 640px) {
    :root {
        --spacing-4xl: 3rem;
        --spacing-3xl: 2.5rem;
        --spacing-2xl: 2rem;
    }
    
    /* Header */
    .header {
        padding: var(--spacing-md) 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .header-actions .btn {
        display: none;
    }
    
    /* Mobile Menu */
    .nav-menu {
        max-width: 100%;
        padding: var(--spacing-2xl);
    }
    
    /* Hero */
    .hero {
        padding: 100px 0 var(--spacing-3xl);
    }
    
    .hero-badge {
        font-size: 0.7rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Section Header */
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    /* Portfolio */
    .portfolio-item {
        aspect-ratio: 4/3;
    }
    
    /* CTA */
    .cta-section {
        padding: var(--spacing-xl);
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
    }
    
    /* Scroll indicator - hide on mobile */
    .scroll-indicator {
        display: none;
    }
    
    /* Custom cursor - hide on touch devices */
    .custom-cursor,
    .cursor-dot {
        display: none;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .service-card:hover {
        transform: none;
    }
    
    .portfolio-item:hover img {
        transform: none;
    }
    
    .team-card:hover .team-image img {
        transform: none;
    }
    
    /* Make touch targets larger */
    .nav-link {
        padding: var(--spacing-sm) 0;
    }
    
    .footer-link {
        padding: var(--spacing-xs) 0;
    }
    
    /* Show portfolio overlay always */
    .portfolio-overlay {
        opacity: 1;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .header,
    .footer,
    .nav,
    .btn,
    .scroll-indicator,
    .custom-cursor,
    .page-loader {
        display: none !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p, blockquote {
        orphans: 3;
        widows: 3;
    }
}

/* ==========================================================================
   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;
    }
    
    .hero-bg::before,
    .hero-bg::after,
    .hero-float {
        animation: none;
    }
    
    [data-animate] {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Dark Mode Responsive Adjustments
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f0f0f;
        --bg-secondary: #18181b;
        --text-primary: #fafafa;
        --text-secondary: #a1a1aa;
        --text-muted: #71717a;
        --border-light: #27272a;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #4338ca;
        --text-primary: #000000;
        --text-secondary: #1f1f1f;
        --border-light: #000000;
    }
    
    .btn-primary {
        border: 2px solid #000000;
    }
    
    .card {
        border-width: 2px;
    }
}

/* ==========================================================================
   Landscape Phone
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 var(--spacing-2xl);
    }
    
    .hero-visual {
        display: none;
    }
}
