/* ================================================
   LENS & LIGHT - RESPONSIVE STYLES
   ================================================ */

/* ============================================
   Large Desktop (1400px and below)
   ============================================ */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-content {
        gap: 40px;
    }
    
    .hero-img-wrapper {
        max-width: 400px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .portfolio-item.large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ============================================
   Desktop (1200px and below)
   ============================================ */
@media (max-width: 1200px) {
    :root {
        --section-padding: 100px;
    }
    
    .nav-list {
        gap: 30px;
    }
    
    .about-grid {
        gap: 60px;
    }
    
    .contact-grid {
        gap: 60px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-card.featured {
        grid-column: span 2;
    }
}

/* ============================================
   Tablet Landscape (1024px and below)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }
    
    /* Navigation */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 30px;
    }
    
    .nav-link {
        font-size: 1.5rem;
    }
    
    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 140px;
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-image {
        order: 1;
    }
    
    .hero-img-wrapper {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .hero-description {
        margin: 0 auto 35px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        margin: 40px auto 0;
        justify-content: center;
    }
    
    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .about-images {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .about-content {
        text-align: center;
    }
    
    .about-content .section-subtitle {
        padding-left: 0;
    }
    
    .about-content .section-subtitle::before {
        display: none;
    }
    
    .feature-item {
        text-align: left;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-info .section-subtitle {
        padding-left: 0;
    }
    
    .contact-info .section-subtitle::before {
        display: none;
    }
    
    .info-items {
        max-width: 400px;
        margin: 0 auto 40px;
    }
    
    .info-item {
        text-align: left;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Newsletter */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        max-width: 100%;
    }
}

/* ============================================
   Tablet Portrait (900px and below)
   ============================================ */
@media (max-width: 900px) {
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card.featured {
        grid-column: span 1;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

/* ============================================
   Mobile Large (768px and below)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }
    
    /* Typography */
    h1 { font-size: clamp(2rem, 6vw, 3rem); }
    h2 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    h3 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
    
    /* Container */
    .container {
        padding: 0 20px;
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding-bottom: 60px;
    }
    
    .hero-content {
        padding-top: 120px;
    }
    
    .hero-img-wrapper {
        max-width: 300px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 25px;
        padding: 25px;
    }
    
    .stat-item {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid var(--border);
    }
    
    .stat-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* About */
    .about-images {
        max-width: 100%;
    }
    
    .about-img-wrapper.img-1 {
        width: 80%;
    }
    
    .about-img-wrapper.img-2 {
        width: 50%;
        bottom: -20px;
    }
    
    .experience-badge {
        right: 10px;
        padding: 20px 25px;
    }
    
    .exp-number {
        font-size: 2.5rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-img {
        height: 200px;
    }
    
    /* Portfolio */
    .portfolio-filter {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    /* Testimonials */
    .testimonial-text {
        font-size: 1.2rem;
    }
    
    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }
    
    .author-info {
        text-align: center;
    }
    
    /* Contact Form */
    .contact-form {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .contact-form-wrapper {
        padding: 30px;
    }
    
    /* Newsletter */
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-input-group input {
        width: 100%;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-links a:hover {
        padding-left: 0;
    }
    
    .footer-contact li {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 28px;
    }
    
    .btn-lg {
        padding: 15px 35px;
    }
    
    /* Page Header */
    .page-header {
        padding: 150px 0 80px;
    }
}

/* ============================================
   Mobile Medium (576px and below)
   ============================================ */
@media (max-width: 576px) {
    :root {
        --section-padding: 50px;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 15px;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    /* Hero */
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* About */
    .about-img-wrapper.img-1 {
        width: 85%;
    }
    
    .about-img-wrapper.img-2 {
        width: 55%;
    }
    
    .experience-badge {
        top: 20px;
        right: 0;
        padding: 15px 20px;
    }
    
    .exp-number {
        font-size: 2rem;
    }
    
    .exp-text {
        font-size: 0.75rem;
    }
    
    /* Features */
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-item {
        aspect-ratio: 4/3;
    }
    
    /* Testimonials */
    .testimonial-content {
        padding: 20px;
    }
    
    .slider-controls {
        gap: 15px;
    }
    
    .slider-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Blog */
    .blog-img {
        height: 200px;
    }
    
    /* Contact */
    .contact-form-wrapper {
        padding: 25px 20px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 15px;
    }
    
    /* Info Items */
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* CTA */
    .cta-section {
        padding: 80px 0;
    }
    
    /* Footer */
    .footer {
        padding: 60px 0 25px;
    }
    
    .footer-bottom {
        padding-top: 20px;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        padding: 10px;
    }
    
    /* Custom Cursor - Hide on touch devices */
    .cursor,
    .cursor-follower {
        display: none;
    }
}

/* ============================================
   Mobile Small (400px and below)
   ============================================ */
@media (max-width: 400px) {
    .container {
        padding: 0 15px;
    }
    
    /* Hero */
    .hero-img-wrapper {
        max-width: 250px;
    }
    
    .hero-img-border {
        top: 10px;
        left: -10px;
    }
    
    /* Stats */
    .stat-number {
        font-size: 2rem;
    }
    
    /* About Images */
    .about-img-wrapper.img-2 {
        width: 60%;
        bottom: -15px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: 40px;
    }
    
    /* Service Cards */
    .service-content {
        padding: 20px;
    }
    
    /* Blog Cards */
    .blog-content {
        padding: 20px;
    }
    
    /* Filter Buttons */
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.75rem;
    }
}

/* ============================================
   Landscape Orientation Fixes
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        padding-top: 80px;
    }
    
    .hero-text {
        order: 1;
    }
    
    .hero-image {
        order: 2;
    }
    
    .hero-img-wrapper {
        max-width: 250px;
    }
    
    .hero-stats {
        flex-direction: row;
        max-width: 100%;
    }
    
    .nav-menu {
        padding: 20px;
    }
    
    .nav-list {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 1.2rem;
    }
}

/* ============================================
   High DPI / Retina Displays
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders on high DPI */
    .btn,
    .service-card,
    .blog-card,
    .portfolio-item {
        border-width: 0.5px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    .back-to-top,
    .cursor,
    .cursor-follower,
    .preloader,
    .lightbox {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .hero {
        min-height: auto;
        padding: 50px 0;
    }
    
    .hero-bg,
    .hero-overlay {
        display: none;
    }
}

/* ============================================
   Accessibility - Focus States
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    :focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Hide hover effects on touch devices */
    .portfolio-overlay {
        opacity: 1;
    }
    
    .portfolio-info {
        transform: translateY(0);
    }
    
    .service-icon {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Larger touch targets */
    .nav-link,
    .filter-btn,
    .slider-btn,
    .social-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   Dark Mode Preference
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: var(--bg-dark);
        --bg-secondary: var(--bg-dark-secondary);
        --bg-tertiary: var(--bg-dark-tertiary);
        --text: var(--text-dark);
        --text-muted: var(--text-dark-muted);
        --border: rgba(255, 255, 255, 0.1);
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: var(--bg-light);
        --bg-secondary: var(--bg-light-secondary);
        --bg-tertiary: var(--bg-light-tertiary);
        --text: var(--text-light);
        --text-muted: var(--text-light-muted);
        --border: rgba(0, 0, 0, 0.1);
    }
}
