@layer base, components, utilities;

@layer base {
    :root {
        /* Design Tokens - Strict Mockup 3 (Immersive Dark) */
        --color-bg: #06080a;
        --color-surface: #111418;
        --color-surface-hover: #1a1e24;
        --color-primary: #f9b115;
        --color-primary-hover: #e09e12;
        --color-text: #f8fafc;
        --color-text-muted: #64748b;
        --color-border: #1e293b;

        /* Header specific */
        --color-text-header: #0f172a;

        --font-main: 'Inter', system-ui, -apple-system, sans-serif;
        --container-max: 1400px;

        /* ARCHITECT NOTE: Reduced padding to fix "gap" issues while maintaining breathability */
        --section-padding: clamp(3.5rem, 5vw, 7rem);

        --radius-sm: 8px;
        --radius-md: 20px;
        --radius-pill: 99px;
        --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

        /* Specific Hero Contrast Tokens */
        --hero-text: #f8fafc;
        --hero-text-muted: #94a3b8;
    }


    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    html {
        scroll-behavior: smooth;
        overflow-x: hidden;
    }

    body {
        font-family: var(--font-main);
        background-color: var(--color-bg);
        color: var(--color-text);
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    /* Prevent scrolling when mobile menu is open */
    body.nav-open {
        overflow: hidden;
    }

    .container {
        max-width: var(--container-max);
        margin: 0 auto;
        padding: 0 2.5rem;
    }

    h1,
    h2,
    h3 {
        line-height: 1.1;
        margin-bottom: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.04em;
    }

    /* REVISED TYPOGRAPHY: More modest clamping for mobile */
    h1 {
        font-size: clamp(2.5rem, 6vw, 5.5rem);
    }

    h2 {
        font-size: clamp(2rem, 4.5vw, 3.5rem);
    }

    h1 span,
    h2 span {
        color: var(--color-primary);
    }
}

@layer components {

    /* Header */
    .site-header {
        padding: 0.8rem 0;
        position: sticky;
        top: 0;
        background: #ffffff;
        z-index: 1000;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
        transition: padding 0.3s ease, box-shadow 0.3s ease;
    }

    .site-header.scrolled {
        padding: 0.4rem 0;
        background: #ffffff;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    }

    .nav-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo-img {
        height: 100px;
        width: auto;
        transition: height 0.2s ease;
    }

    .nav-links {
        display: flex;
        list-style: none;
        gap: 2rem;
        align-items: center;
    }

    .nav-links a {
        text-decoration: none;
        color: var(--color-text-header);
        font-weight: 700;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        transition: color 0.2s;
    }

    .nav-links a:hover {
        color: var(--color-primary);
    }

    .nav-links a.active {
        color: var(--color-primary);
    }

    /* Mobile Menu Toggle - REFINED STYLING */
    .mobile-menu-btn {
        display: none;
        /* Hidden on desktop */
        background: transparent;
        border: 1px solid transparent;
        /* Reserve space for border state */
        cursor: pointer;
        z-index: 1002;
        color: var(--color-text-header);
        border-radius: var(--radius-sm);
        transition: all 0.2s ease;

        /* Proportions & Alignment */
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        /* Push to right if needed in flex container */
    }

    /* Hover & Active States */
    .mobile-menu-btn:hover {
        background-color: #f1f5f9;
        color: var(--color-primary);
    }

    .mobile-menu-btn.active {
        background-color: #f1f5f9;
        border-color: #e2e8f0;
        color: var(--color-primary);
    }

    .mobile-menu-btn svg {
        width: 24px;
        height: 24px;
        stroke-width: 2;
        /* Ensure lines are crisp */
    }


    /* Buttons & Badges */
    .btn {
        display: inline-flex;
        align-items: center;
        padding: 1.1rem 2.6rem;
        border-radius: var(--radius-pill);
        font-weight: 800;
        text-decoration: none;
        transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        text-transform: uppercase;
        font-size: 0.85rem;
        border: none;
        cursor: pointer;
    }

    .btn-primary {
        background: var(--color-primary);
        color: #000;
        box-shadow: 0 10px 30px rgba(249, 177, 21, 0.2);
    }

    .btn-primary:hover {
        transform: translateY(-3px) scale(1.02);
        background: var(--color-primary-hover);
        box-shadow: 0 15px 35px rgba(249, 177, 21, 0.35);
    }

    .btn-secondary {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
    }

    .btn-secondary:hover {
        background: var(--color-primary);
        color: #000;
        border-color: var(--color-primary);
        box-shadow: 0 15px 35px rgba(249, 177, 21, 0.35);
        transform: translateY(-3px) scale(1.02);
    }

    .badge {
        display: inline-flex;
        background: rgba(249, 177, 21, 0.1);
        color: var(--color-primary);
        padding: 0.6rem 1.4rem;
        border-radius: var(--radius-pill);
        font-size: 0.7rem;
        font-weight: 900;
        text-transform: uppercase;
        margin-bottom: 2rem;
        border: 1px solid rgba(249, 177, 21, 0.2);
        letter-spacing: 0.1em;
    }

    /* Immersive Hero Base - Straight edge for Home Page stability */
    .hero.v3-immersive {
        /* ARCHITECT NOTE: Using min-height instead of height allows the container to dynamically expand to fit the content inside it */
        min-height: max(66vh, 520px);
        display: flex;
        align-items: center;
        position: relative;
        background-color: #000;
        background-image: url('/assets/images/homehero.png');
        background-size: cover;
        background-position: center;
        overflow: hidden;
    }

    /* Subpage Hero Variant - Keep the slant where it doesn't clash with Trust Bars */
    .hero.hero-subpage {
        clip-path: polygon(0 0, 100% 0, 100% 96%, 0% 100%);
        /* ARCHITECT NOTE: The CTA cutoff was caused by a rigid 40vh height limit. 
           This min-height formulation guarantees at least 40vh, but allows it to push to 480px+ 
           so CTAs and text are never clipped. */
        min-height: max(40vh, 480px);
        background-image: url('/assets/images/sub.jpeg');
    }

    .hero-bg-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to right,
                rgba(6, 8, 10, 0.98) 0%,
                rgba(6, 8, 10, 0.8) 40%,
                rgba(6, 8, 10, 0.3) 100%);
        z-index: 1;
    }


    .hero-container {
        position: relative;
        z-index: 2;
        width: 100%;
        padding-top: 4rem;
        padding-bottom: 5rem;
    }

    .hero-content {
        max-width: 850px;
    }

    .hero-content h1 {
        color: var(--hero-text);
    }

    .hero-content p {
        color: var(--hero-text-muted);
        font-size: 1.3rem;
        margin-bottom: 3.5rem;
        max-width: 600px;
    }

    .hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Trust Bar Component */
    .trust-bar {
        padding: 2.5rem 0;
        /* ARCHITECT NOTE: Reduced from 4rem for tighter fit */
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        overflow: hidden;
        /* Essential for the scroller */
    }

    .trust-bar p {
        margin-bottom: 2.5rem;
        font-size: 0.75rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.3em;
        color: var(--color-text-muted);
        text-align: center;
    }

    /* Infinite Scroller Container */
    .trust-scroller {
        display: flex;
        width: 100%;
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    }

    .trust-scroller-track {
        display: flex;
        gap: 5rem;
        padding-left: 2.5rem;
        /* Offset for gap */
        animation: scroll 40s linear infinite;
        width: max-content;
        /* Ensure track fits all items */
    }

    /* Pause animation on hover for accessibility/user interest */
    .trust-scroller:hover .trust-scroller-track {
        animation-play-state: paused;
    }

    .trust-logo-img {
        height: 40px;
        /* Increased from 32px */
        width: auto;
        opacity: 0.85;
        /* Increased from 0.45 */
        filter: grayscale(100%) brightness(2.5);
        /* Lift dark logos to light silver */
        transition: all 0.3s ease;
        flex-shrink: 0;
        /* Prevent squishing */
    }

    /* Specific fix for logos with black/dark text: Invert them to make black text white */
    .trust-logo-img[alt="Maersk"],
    .trust-logo-img[alt="FTI"],
    .trust-logo-img[alt="ServiceMaster"] {
        filter: grayscale(100%) invert(1) brightness(2);
    }

    @keyframes scroll {
        to {
            transform: translateX(calc(-50% - 2.5rem));
            /* Move half the width (one set) + half the gap */
        }
    }

    /* Grids & Cards */
    .services-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
        gap: 1.5rem;
        margin-top: 4rem;
    }

    /* Testimonial Slider Styles */
    .section-header-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        margin-bottom: 3rem;
        flex-wrap: wrap;
        gap: 2rem;
    }

    .slider-controls {
        display: flex;
        gap: 1rem;
    }

    .slider-btn {
        background: transparent;
        border: 1px solid var(--color-border);
        color: var(--color-text);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .slider-btn:hover {
        background: var(--color-primary);
        color: #000;
        border-color: var(--color-primary);
    }

    .testimonial-slider-container {
        overflow: hidden;
        /* Hide scrollbar but allow JS scroll */
        width: 100%;
        padding-bottom: 1rem;
    }

    .testimonial-track {
        display: flex;
        gap: 2rem;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        padding-bottom: 1rem;
        /* Space for shadow */
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .testimonial-track::-webkit-scrollbar {
        display: none;
    }

    .testimonial-slide {
        min-width: min(calc(100vw - 5rem), 350px);
        max-width: 350px;
        scroll-snap-align: start;
        flex-shrink: 0;
        border-left: 4px solid var(--color-primary);
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .testimonial-logo {
        height: 40px;
        width: auto;
        margin: 0 auto 1.5rem auto;
        display: block;
        filter: grayscale(100%) brightness(2.5);
        opacity: 0.8;
    }

    /* Specific override for Maersk in testimonials */
    .testimonial-logo[alt="Maersk"] {
        height: 60px;
        /* Increase size for Maersk */
    }

    .service-card {
        position: relative;
        background: var(--color-surface);
        padding: 4.5rem 3.5rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        height: 100%;
        opacity: 0;
        transform: translateY(30px);
        overflow: hidden;
    }

    @media (max-width: 480px) {
        .service-card {
            padding: 2.5rem 1.5rem;
        }

        .testimonial-slide {
            min-width: calc(100vw - 5rem);
            max-width: calc(100vw - 5rem);
        }
    }

    .service-card.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .service-card:hover {
        transform: translateY(-10px);
        border-color: var(--color-primary);
        box-shadow: var(--shadow-lg);
        background: var(--color-surface-hover);
    }

    .service-card-accent {
        position: absolute;
        top: -1.5rem;
        right: -1.5rem;
        color: var(--color-primary);
        opacity: 0.06;
        transform: rotate(15deg);
        transition: all 0.5s ease;
        pointer-events: none;
        z-index: 1;
    }

    .service-card-accent svg {
        width: 140px;
        height: 140px;
    }

    .service-card:hover .service-card-accent {
        opacity: 0.12;
        transform: rotate(25deg) scale(1.1);
    }

    .service-icon {
        color: var(--color-primary);
        margin-bottom: 2.5rem;
        background: rgba(249, 177, 21, 0.05);
        width: 64px;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        position: relative;
        z-index: 2;
    }

    /* Emergency Breakdown Call-out */
    .service-card.is-emergency {
        border-color: var(--color-primary);
        background: linear-gradient(135deg, var(--color-surface) 0%, rgba(249, 177, 21, 0.05) 100%);
    }

    .emergency-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        font-size: 0.75rem;
        font-weight: 800;
        text-transform: uppercase;
        color: var(--color-primary);
        margin-bottom: 1.2rem;
        letter-spacing: 0.05em;
    }

    .pulse-dot {
        width: 8px;
        height: 8px;
        background: var(--color-primary);
        border-radius: 50%;
        box-shadow: 0 0 0 rgba(249, 177, 21, 0.4);
        animation: pulse 1.5s infinite;
    }

    @keyframes pulse {
        0% {
            box-shadow: 0 0 0 0px rgba(249, 177, 21, 0.7);
        }

        70% {
            box-shadow: 0 0 0 10px rgba(249, 177, 21, 0);
        }

        100% {
            box-shadow: 0 0 0 0px rgba(249, 177, 21, 0);
        }
    }

    .btn-text {
        display: inline-block;
        margin-top: 1.5rem;
        color: var(--color-primary);
        text-decoration: none;
        font-weight: 700;
        font-size: 0.9rem;
    }

    /* Machine Support Interactive Components - DEPRECATED for Home, kept for fallback */
    .machine-support-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8rem;
        align-items: center;
    }

    .machine-support-list {
        display: flex;
        flex-direction: column;
    }

    .machine-support-item {
        padding: 2.5rem 0;
        border-bottom: 1px solid var(--color-border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        transition: all 0.3s ease;
        opacity: 0.4;
    }

    .machine-support-item:hover,
    .machine-support-item.active {
        opacity: 1;
        border-bottom-color: var(--color-primary);
    }

    .machine-support-item h3 {
        margin-bottom: 0.5rem;
        font-size: 1.5rem;
        transition: color 0.3s ease;
    }

    .machine-support-item p {
        font-size: 0.95rem;
        color: var(--color-text-muted);
    }

    .machine-support-item.active h3 {
        color: var(--color-primary);
    }

    .machine-support-item .arrow {
        transform: translateX(-15px);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        color: var(--color-primary);
    }

    .machine-support-item:hover .arrow,
    .machine-support-item.active .arrow {
        transform: translateX(0);
        opacity: 1;
    }

    .machine-support-visual {
        position: sticky;
        top: 150px;
    }

    .visual-frame {
        position: relative;
        border-radius: var(--radius-md);
        overflow: hidden;
        aspect-ratio: 4 / 3;
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
    }

    .machine-img-dynamic {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: opacity 0.4s ease, transform 0.6s ease;
    }

    /* --- HOME MASONRY SECTION (NEW) --- */
    .home-masonry-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
        gap: 2rem;
        margin-top: 3rem;
    }

    .home-service-card {
        display: flex;
        flex-direction: column;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        overflow: hidden;
        text-decoration: none;
        transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    }

    .home-service-card:hover {
        transform: translateY(-5px);
        border-color: var(--color-primary);
        box-shadow: var(--shadow-lg);
    }

    .home-service-card .card-image {
        position: relative;
        aspect-ratio: 16/9;
        overflow: hidden;
        background: #000;
        border-bottom: 1px solid var(--color-border);
    }

    .home-service-card .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
        filter: grayscale(20%);
        /* Slight industrial mood */
    }

    .home-service-card:hover .card-image img {
        transform: scale(1.05);
        filter: grayscale(0%);
    }

    .home-service-card .card-content {
        padding: 2rem;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    .home-service-card h3 {
        color: var(--color-text);
        margin-bottom: 0.5rem;
        font-size: 1.5rem;
    }

    .home-service-card p {
        color: var(--color-text-muted);
        margin-bottom: 2rem;
        flex-grow: 1;
        font-size: 0.95rem;
    }

    .home-service-card .card-action {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--color-primary);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.8rem;
        letter-spacing: 0.05em;
        margin-top: auto;
        /* Push to bottom */
    }

    .home-service-card .card-action .arrow {
        transition: transform 0.3s ease;
    }

    .home-service-card:hover .card-action .arrow {
        transform: translateX(4px);
    }

    /* Desktop "Bento/Masonry" Layout Enhancements */
    @media (min-width: 1024px) {
        .home-masonry-grid {
            grid-template-columns: repeat(12, 1fr);
            gap: 2rem;
        }

        /* Layout Logic: 
           Row 1: Card 1 (7 cols), Card 2 (5 cols)
           Row 2: Card 3 (5 cols), Card 4 (7 cols)
           Creates a nice staggered visual balance
        */
        .home-service-card:nth-child(1) {
            grid-column: span 7;
        }

        .home-service-card:nth-child(2) {
            grid-column: span 5;
        }

        .home-service-card:nth-child(3) {
            grid-column: span 5;
        }

        .home-service-card:nth-child(4) {
            grid-column: span 7;
        }

        /* Vary heights for visual interest if desired, or keep uniform aspect ratios */
        .home-service-card .card-image {
            aspect-ratio: 16/9;
            /* Consistent ratio ensures clean grid lines */
        }
    }

    /* --- SERVICES ACCORDION STYLES --- */
    .services-accordion {
        max-width: 1000px;
        margin: 0 auto;
        border-top: 1px solid var(--color-border);
    }

    details {
        border-bottom: 1px solid var(--color-border);
        background: var(--color-surface);
        transition: background-color 0.2s ease;
        /* Default border to transparent so layout doesn't jump */
        border-left: 4px solid transparent;
    }

    details:hover {
        background: var(--color-surface-hover);
    }

    /* Highlight ANY open accordion item */
    details[open] {
        background: var(--color-surface-hover);
        border-left: 4px solid var(--color-primary);
    }

    summary {
        list-style: none;
        cursor: pointer;
        padding: 2rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    summary::-webkit-details-marker {
        display: none;
    }

    .summary-content {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }

    .accordion-icon {
        color: var(--color-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(249, 177, 21, 0.05);
        width: 48px;
        height: 48px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .accordion-title h3 {
        margin: 0;
        font-size: 1.25rem;
        color: var(--color-text);
    }

    .accordion-title .emergency-tag {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-primary);
        font-weight: 800;
        display: block;
        margin-bottom: 0.25rem;
    }

    .accordion-toggle-icon {
        transition: transform 0.3s ease;
        color: var(--color-text-muted);
    }

    details[open] .accordion-toggle-icon {
        transform: rotate(180deg);
        color: var(--color-primary);
    }

    .accordion-body {
        padding: 0 2rem 2rem 2rem;
        color: var(--color-text-muted);
        line-height: 1.7;
        max-width: 800px;
        margin-left: calc(48px + 1.5rem);
        /* Align with text */
    }

    @media (max-width: 768px) {
        .summary-content {
            gap: 1rem;
        }

        .accordion-icon {
            width: 40px;
            height: 40px;
        }

        .accordion-body {
            margin-left: 0;
            padding-left: 1rem;
            padding-right: 1rem;
        }

        .accordion-title h3 {
            font-size: 1.1rem;
        }
    }

    /* Back to Top Button */
    .back-to-top {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        background: var(--color-primary);
        color: #000;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
        z-index: 900;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        opacity: 0;
        visibility: hidden;
        transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    }

    .back-to-top.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .back-to-top:hover {
        background: var(--color-primary-hover);
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }

    .back-to-top svg {
        width: 24px;
        height: 24px;
    }

    /* --- ANIMATION UTILITIES --- */
    .reveal-target {
        opacity: 0;
        transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
        will-change: opacity, transform;
    }

    .reveal-up {
        transform: translateY(40px);
    }

    .reveal-scale {
        transform: scale(0.92);
    }

    .reveal-fade {
        transform: translateY(0);
    }

    .reveal-left {
        transform: translateX(-40px);
    }

    .reveal-right {
        transform: translateX(40px);
    }

    .reveal-target.revealed {
        opacity: 1;
        transform: translateY(0) scale(1) translateX(0);
    }

    /* Stagger Delays */
    .delay-100 {
        transition-delay: 100ms;
    }

    .delay-200 {
        transition-delay: 200ms;
    }

    .delay-300 {
        transition-delay: 300ms;
    }

    .delay-400 {
        transition-delay: 400ms;
    }

    .delay-500 {
        transition-delay: 500ms;
    }

}

@layer utilities {
    .section-title-area {
        max-width: 800px;
        margin-bottom: 3.5rem;
        /* ARCHITECT NOTE: Reduced from 5rem for tighter spacing */
    }

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

    .mx-auto {
        margin-inline: auto;
    }

    @media (max-width: 768px) {
        .logo-img {
            height: 70px;
        }
    }

    @media (max-width: 1024px) {
        .hero.v3-immersive {
            height: auto;
            min-height: auto;
            /* Reset base rule to ensure fluid layout on mobile */
            padding: 5rem 0;
            clip-path: none;
        }

        /* Mobile Navigation Logic */
        .mobile-menu-btn {
            display: flex;
        }

        .nav-links {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            width: 80vw;
            max-width: 400px;
            /* Ensure the menu has a solid background color that matches the site header */
            background: #ffffff;
            flex-direction: column;
            justify-content: center;
            align-items: flex-start;
            padding: 4rem 2.5rem;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
            transform: translateX(110%);
            /* Hidden by default */
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            z-index: 1001;
            border-left: 1px solid var(--color-border);
        }

        .nav-links.open {
            transform: translateX(0);
        }

        .nav-links a {
            font-size: 1.2rem;
            padding: 1rem 0;
            width: 100%;
            border-bottom: 1px solid var(--color-border);
            /* Explicitly set text color to ensure readability against white bg */
            color: var(--color-text-header);
        }

        .nav-links li {
            width: 100%;
        }

        .nav-links .btn {
            display: none;
        }

        .machine-support-layout {
            grid-template-columns: 1fr;
            gap: 4rem;
        }

        .machine-support-visual {
            position: relative;
            top: 0;
            order: -1;
        }
    }
}

/* Footer Module Styles */
.footer-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3rem;
    padding-top: 1rem;
}

.footer-info {
    flex: 1 1 250px;
}

.footer-info .copyright {
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.footer-info .subtext {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-areas {
    flex: 2 1 400px;
}

.footer-areas h4 {
    color: var(--color-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.area-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0;
}

.area-list li {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    position: relative;
}

.area-list li:not(:last-child)::after {
    margin-left: 1rem;
    opacity: 0.3;
    color: var(--color-text-muted);
}