/* ============================================
   JM2 ENGINEERING - RESPONSIVE STYLES
   Breakpoints: 2560px+, 1200px, 768px, 480px
   ============================================ */

/* --- Ultrawide monitors (2560px+) --- */
@media (min-width: 2560px) {
    :root {
        --container-max: 1800px;
    }

    /* Service panels extend to edges naturally via vw units */
    .service-panel .service-inner {
        max-width: 600px;
    }

    .team-member {
        width: 320px;
    }

    .carousel-btn-prev {
        left: -100px;
    }

    .carousel-btn-next {
        right: -100px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

/* --- Super ultrawide (3440px+) --- */
@media (min-width: 3440px) {
    :root {
        --container-max: 2000px;
    }

    /* Service panels use vw units so they scale with any width */
    .service-panel .service-inner {
        max-width: 700px;
    }

    .team-member {
        width: 350px;
    }

    .carousel-btn-prev {
        left: -120px;
    }

    .carousel-btn-next {
        right: -120px;
    }
}

/* --- Large tablets and small desktops --- */
@media (max-width: 1200px) {
    :root {
        --section-padding: 80px;
    }

    .nav-button {
        min-width: 140px;
        font-size: 0.9rem;
    }

    .hero-logo {
        max-width: 350px;
    }

    /* Service panels - adjust for smaller screens */
    .service-panel.left .service-skew {
        right: 35%;
        padding-right: 8vw;
    }

    .service-panel.right .service-skew {
        left: 35%;
        padding-left: 8vw;
    }

    .service-panel .service-inner {
        max-width: 450px;
    }

    .team-member {
        width: 450px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .contact-grid {
        gap: 3rem;
    }

    .footer-grid {
        gap: 3rem;
    }
}

/* --- Tablets --- */
@media (max-width: 992px) {
    /* Header */
    .nav-list {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .header-inner {
        padding: 0 1.5rem;
    }

    /* Hero */
    .hero-background-left {
        width: 100%;
    }

    .hero-background-right {
        display: none;
    }

    .hero-content {
        padding: 120px 1.5rem 2rem;
    }

    /* Services */
    .service-panel {
        min-height: 300px;
    }

    /* Service panels - adjust for tablet */
    .service-panel.left .service-skew {
        right: 30%;
        padding-right: 6vw;
    }

    .service-panel.right .service-skew {
        left: 30%;
        padding-left: 6vw;
    }

    .service-panel .service-inner {
        max-width: 400px;
    }

    .service-inner p {
        font-size: 1rem;
    }

    /* Team carousel - tablet */
    .team-member {
        width: 240px;
    }

    .carousel-wrapper {
        padding: 0 70px;
    }

    .carousel-btn {
        width: 50px;
        height: 50px;
    }

    .carousel-btn-prev {
        left: -60px;
    }

    .carousel-btn-next {
        right: -60px;
    }

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

    .contact-info {
        text-align: center;
    }

    .contact-details li {
        justify-content: center;
    }

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

    .footer-brand {
        grid-column: span 2;
        text-align: center;
    }

    .footer-brand img {
        margin: 0 auto 1rem;
    }
}

/* --- Mobile landscape and small tablets --- */
@media (max-width: 768px) {
    :root {
        --header-height: 80px;
        --header-height-scrolled: 70px;
        --section-padding: 60px;
    }

    h1 { font-size: clamp(2rem, 6vw, 2.5rem); }
    h2 { font-size: clamp(1.75rem, 5vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 4vw, 1.5rem); }

    .container {
        padding: 0 1rem;
    }

    /* Hero */
    .hero {
        min-height: 500px;
    }

    .hero-logo {
        max-width: 280px;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .scroll-indicator {
        bottom: 20px;
    }

    /* Services - Stack and simplify on mobile */
    .service-panel {
        min-height: auto;
    }

    .service-panel-content {
        min-height: auto;
        flex-direction: column;
    }

    .service-panel.left .service-skew,
    .service-panel.right .service-skew {
        position: relative;
        width: 100%;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        padding: 2rem 1.5rem;
        justify-content: center;
        border-bottom: 4px solid var(--bg-dark);
        opacity: 1 !important;
    }

    .service-panel.left .service-inner,
    .service-panel.right .service-inner {
        transform: none !important;
        text-align: center;
        padding: 0;
        max-width: 100%;
    }

    .service-panel .service-panel-bg {
        height: 200px;
        position: relative;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        height: 220px;
    }

    .projects-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Team - show 1 center + partial sides on mobile */
    .team-member {
        width: 260px;
        max-width: 75vw;
        padding: 1.25rem;
        margin: 0 0.5rem;
    }

    .team-member.distance-0 {
        transform: scale(1.1);
    }

    .team-member.distance-1 {
        opacity: 0.5;
    }

    .team-member.distance-2,
    .team-member.distance-3 {
        opacity: 0;
    }

    .team-member-image {
        width: 120px;
        height: 120px;
    }

    .team-carousel {
        padding: 50px 50px 100px;
        min-height: 800px;
    }

    .carousel-btn {
        width: 44px;
        height: 44px;
    }

    .carousel-btn-prev {
        left: -50px;
    }

    .carousel-btn-next {
        right: -50px;
    }

    /* Contact */
    .contact-form-wrapper {
        padding: 1.5rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
    }

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

    .footer-brand {
        grid-column: auto;
    }

    .footer-links,
    .footer-social {
        text-align: center;
    }

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

/* --- Mobile portrait --- */
@media (max-width: 480px) {
    :root {
        --header-height: 70px;
        --section-padding: 50px;
    }

    /* Header */
    .logo img {
        height: 50px;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
    }

    /* Hero */
    .hero {
        min-height: 100vh;
        min-height: 100svh; /* Safe viewport height */
    }

    .hero-logo {
        max-width: 220px;
    }

    .hero-content {
        padding: 100px 1rem 2rem;
    }

    /* Services - tighter padding on small phones */
    .service-panel.left .service-skew,
    .service-panel.right .service-skew {
        padding: 1.5rem 1rem;
    }

    .service-panel .service-inner {
        max-width: 100%;
    }

    .service-inner p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Projects */
    .project-card {
        height: 200px;
        border-radius: 8px;
    }

    .project-card-title {
        font-size: 1.1rem;
    }

    /* Team */
    .carousel-wrapper {
        padding: 0 20px;
    }

    .team-carousel {
        padding: 50px 20px 100px;
        min-height: 800px;
    }

    .team-member {
        width: 95%;
        margin-right: 1rem;
    }

    .team-member-image {
        width: 120px;
        height: 120px;
    }

    .team-member-bio {
        font-size: 0.9rem;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-btn-prev {
        left: -10px;
    }

    .carousel-btn-next {
        right: -10px;
    }

    /* Contact */
    .contact-info {
        padding: 1rem;
    }

    .contact-form-wrapper {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .submit-btn {
        width: 100%;
        padding: 1rem;
    }

    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-bottom p {
        font-size: 0.8rem;
    }
}

/* --- Very small screens --- */
@media (max-width: 360px) {
    .hero-logo {
        max-width: 180px;
    }

    .hero-tagline {
        font-size: 0.9rem;
    }

    .project-card {
        height: 180px;
    }

    .team-member-image {
        width: 100px;
        height: 100px;
    }
}

/* --- Landscape mobile --- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 1rem 0;
    }

    .hero-content {
        padding-top: 80px;
    }

    .hero-logo {
        max-width: 200px;
        margin-bottom: 1rem;
    }

    .scroll-indicator {
        display: none;
    }
}

/* --- High DPI displays --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp images on retina displays */
    .hero-logo,
    .team-member-image,
    .project-card-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* --- Print styles --- */
@media print {
    .header,
    .scroll-indicator,
    .menu-toggle,
    .nav-overlay,
    .mobile-nav,
    .filter-btn,
    .carousel-btn,
    .carousel-dots {
        display: none !important;
    }

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

    .service-panel.left .service-skew,
    .service-panel.right .service-skew {
        transform: none;
        width: 100%;
    }

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

    body {
        background: white;
        color: black;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}
