/* CSS Variables - Industrial B2B Palette */
:root {
    --deep-navy: #0A2540;
    --steel-blue: #2E5C8A;
    --cool-gray: #4A5568;
    --safety-orange: #FF6B35;
    --mint-green: #4ECDC4;
    --warm-gray: #E8E8E8;
    --light-gray: #F7FAFC;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--cool-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: var(--deep-navy);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo img {
    height: 60px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

/* Desktop Navigation */
.nav-menu {
    display: block;
}

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

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--safety-orange);
}

/* Desktop Dropdown - Invisible Hover Bridge */
.dropdown {
    position: relative;
}

.dropdown > a::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 50px;
    height: 0.5rem;
    background: transparent;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 0.5rem 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--deep-navy);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background: var(--light-gray);
    color: var(--safety-orange);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--deep-navy) 0%, var(--steel-blue) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero .subhead {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Services Section */
.services {
    padding: 4rem 2rem;
}

.services h2 {
    text-align: center;
    color: var(--deep-navy);
    margin-bottom: 3rem;
    font-size: 2.25rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.service-card h3 {
    color: var(--deep-navy);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    color: var(--cool-gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Trust Cards */
.trusted-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.trust-card {
    padding: 2rem;
    border-radius: 12px;
    color: white;
    text-align: center;
    transition: transform 0.3s;
}

.trust-card:hover {
    transform: translateY(-4px);
}

.trust-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.trust-card p {
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--safety-orange);
    color: white;
}

.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-secondary {
    background: var(--steel-blue);
    color: white;
}

.btn-secondary:hover {
    background: #1e4a6f;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--deep-navy) 0%, var(--steel-blue) 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Footer */
footer {
    background: var(--deep-navy);
    color: white;
    padding: 3rem 2rem 1.5rem;
}

footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--safety-orange);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

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

    .service-grid,
    .trusted-grid {
        grid-template-columns: 1fr;
    }

    /* Show mobile toggle button */
    .mobile-toggle {
        display: block;
    }

    /* Mobile Menu Hamburger Icon */
    .hamburger {
        width: 24px;
        height: 20px;
        position: relative;
        cursor: pointer;
    }

    .hamburger span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: #ffffff;
        border-radius: 3px;
        opacity: 1;
        left: 0;
        transition: all 0.3s ease;
    }

    .hamburger span:nth-child(1) {
        top: 0;
    }

    .hamburger span:nth-child(2) {
        top: 8px;
    }

    .hamburger span:nth-child(3) {
        top: 16px;
    }

    .hamburger.active span:nth-child(1) {
        top: 8px;
        transform: rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        top: 8px;
        transform: rotate(-45deg);
    }

    /* Mobile Menu Panel - FIXED TO SHOW WHEN ACTIVE */
    .nav-menu {
        position: fixed;
        top: 101px;
        right: -100%;
        width: 75%;
        max-width: 280px;
        height: calc(100vh - 101px);
        background: white;
        box-shadow: -2px 0 8px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
        display: block !important; /* Force display even when ul is hidden */
    }

    .nav-menu.active {
        right: 50px;
        right: 50px;
    }

    .nav-menu ul {
        display: flex !important; /* Override desktop display: none */
        flex-direction: column;
        padding: 1.5rem 0;
        gap: 0;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--warm-gray);
    }

    .nav-menu a {
        display: block;
        padding: 0.875rem 1.5rem;
        color: var(--deep-navy);
        font-weight: 500;
        font-size: 0.95rem;
        transition: background 0.2s, color 0.2s;
    }

    .nav-menu a:hover {
        background: var(--light-gray);
        color: var(--safety-orange);
    }

    /* Mobile Dropdown */
    .nav-menu .dropdown > a::after {
        content: '▼';
        position: absolute;
        right: 1.5rem;
        font-size: 0.75rem;
        height: auto;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        transition: transform 0.3s;
    }

    .nav-menu .dropdown.active > a::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .nav-menu .dropdown-content {
        position: static;
        display: none;
        background: var(--light-gray);
        box-shadow: none;
        margin: 0;
        padding: 0;
        border-radius: 0;
        top: auto;
    }

    .nav-menu .dropdown.active .dropdown-content {
        display: block;
    }

    .nav-menu .dropdown-content a {
        padding: 0.75rem 2rem;
        font-size: 0.875rem;
        color: var(--cool-gray);
    }

    .nav-menu .dropdown > a {
        position: relative;
    }
}

    /* Mobile Menu Active Position Override */
    .nav-menu.active {
        right: -80px !important;
    }

/* Fix Desktop Menu - Ensure Horizontal Layout */
@media (min-width: 769px) {
    .nav-menu {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    
    .nav-menu ul {
        display: flex !important;
        flex-direction: row !important;
        padding: 0 !important;
    }
    
    .nav-menu li {
        border-bottom: none !important;
    }
    
    .mobile-toggle {
        display: none !important;
    }
}

/* DESKTOP MENU FIX - Remove dots, make horizontal */
@media (min-width: 769px) {
    nav ul.nav-menu {
        list-style: none !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 2rem !important;
        align-items: center !important;
    }
    
    nav ul.nav-menu li {
        list-style: none !important;
        list-style-type: none !important;
    }
}

/* DESKTOP DROPDOWN HOVER BRIDGE FIX */
@media (min-width: 769px) {
    .dropdown > a {
        position: relative;
    }
    
    .dropdown > a::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 0.5rem;
        background: transparent;
        pointer-events: auto;
    }
    
    .dropdown-content {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 0 !important;
        display: none !important;
        background: white !important;
        min-width: 220px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        border-radius: 4px !important;
        padding: 0.5rem 0 !important;
        z-index: 1000 !important;
    }
    
    .dropdown:hover .dropdown-content {
        display: block !important;
    }
}

/* LOGO VIBRATE ANIMATION ON HOVER */
@keyframes vibrate {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-1.5px, -1.5px); }
    20% { transform: translate(1.5px, 1.5px); }
    30% { transform: translate(-1.5px, 1.5px); }
    40% { transform: translate(1.5px, -1.5px); }
    50% { transform: translate(-1.5px, -1.5px); }
    60% { transform: translate(1.5px, 1.5px); }
    70% { transform: translate(-1.5px, 1.5px); }
    80% { transform: translate(1.5px, -1.5px); }
    90% { transform: translate(-1.5px, -1.5px); }
    100% { transform: translate(0, 0); }
}

@media (min-width: 769px) {
    .logo a:hover img {
        animation: vibrate 0.08s ease-in-out infinite;
    }
}

/* DESKTOP SUBMENU HOVER BRIDGE - STRONGEST OVERRIDE */
@media (min-width: 769px) {
    /* Make the dropdown parent link have a hover area that extends down */
    .dropdown {
        position: relative;
    }
    
    /* Invisible bridge between link and dropdown */
    .dropdown::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 0.75rem;
        background: transparent;
        display: block;
        z-index: 999;
    }
    
    /* Ensure dropdown shows on parent hover */
    .dropdown:hover > .dropdown-content,
    .dropdown-content:hover {
        display: block !important;
    }
    
    /* Position dropdown accounting for bridge */
    .dropdown > .dropdown-content {
        top: calc(100% + 0.75rem) !important;
    }
}


/* FIX MOBILE HORIZONTAL SCROLL */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    width: 100%;
}

/* Ensure all containers fit within viewport on mobile */
@media (max-width: 768px) {
    * {
        max-width: 100%;
    }
    
    .container {
        padding: 0 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    table {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }
}

}


.bounce-letter:hover {
    transform: translateY(-8px);
    animation: letterBounce 0.5s ease-in-out;
}

@keyframes letterBounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
    50% { transform: translateY(-4px); }
    70% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

}

}

}

/* HERO BACKGROUND - COMPLEX SOUND WAVES WITH FEATHERED EDGES */
.hero {
    position: relative;
    overflow: hidden;
}

@keyframes wavePulse1 {
    0%, 100% { transform: scale(1); opacity: 0.22; }
    50% { transform: scale(1.1); opacity: 0.22; }
}

@keyframes wavePulse2 {
    0%, 100% { transform: scale(1); opacity: 0.12; }
    50% { transform: scale(1.15); opacity: 0.20; }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Primary wave source - center (white waves with feathered edges) */
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 33%, rgba(255, 255, 255, 0.18) 35%, rgba(255, 255, 255, 0.18) 36%, rgba(255, 255, 255, 0.06) 38%, transparent 40%),
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 43%, rgba(255, 255, 255, 0.15) 45%, rgba(255, 255, 255, 0.15) 46%, rgba(255, 255, 255, 0.03) 48%, transparent 50%),
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 53%, rgba(255, 255, 255, 0.12) 55%, rgba(255, 255, 255, 0.12) 56%, rgba(255, 255, 255, 0.02) 58%, transparent 60%),
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 63%, rgba(255, 255, 255, 0.09) 65%, rgba(255, 255, 255, 0.09) 66%, rgba(255, 255, 255, 0.02) 68%, transparent 70%),
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 73%, rgba(255, 255, 255, 0.06) 75%, rgba(255, 255, 255, 0.06) 76%, rgba(255, 255, 255, 0.01) 78%, transparent 80%),
        /* Dark waves for contrast */
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 38%, rgba(0, 0, 0, 0.12) 40%, rgba(0, 0, 0, 0.12) 41%, rgba(0, 0, 0, 0.02) 43%, transparent 45%),
        radial-gradient(ellipse 70% 45% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.09) 60%, rgba(0, 0, 0, 0.09) 61%, rgba(0, 0, 0, 0.02) 63%, transparent 65%),
        /* Secondary wave source - left */
        radial-gradient(circle at 20% 40%, transparent 18%, rgba(255, 255, 255, 0.09) 20%, rgba(255, 255, 255, 0.09) 21%, rgba(255, 255, 255, 0.02) 23%, transparent 25%),
        radial-gradient(circle at 20% 40%, transparent 28%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.08) 31%, rgba(255, 255, 255, 0.01) 33%, transparent 35%),
        radial-gradient(circle at 20% 40%, transparent 38%, rgba(0, 0, 0, 0.06) 40%, rgba(0, 0, 0, 0.06) 41%, rgba(0, 0, 0, 0.01) 43%, transparent 45%),
        /* Tertiary wave source - right */
        radial-gradient(circle at 80% 60%, transparent 23%, rgba(255, 255, 255, 0.09) 25%, rgba(255, 255, 255, 0.09) 26%, rgba(255, 255, 255, 0.02) 28%, transparent 30%),
        radial-gradient(circle at 80% 60%, transparent 33%, rgba(0, 0, 0, 0.08) 35%, rgba(0, 0, 0, 0.08) 36%, rgba(0, 0, 0, 0.01) 38%, transparent 40%),
        radial-gradient(circle at 80% 60%, transparent 43%, rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.06) 46%, rgba(255, 255, 255, 0.01) 48%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: wavePulse1 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Additional offset waves for complexity */
        radial-gradient(ellipse 65% 40% at 55% 45%, transparent 38%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 255, 255, 0.12) 41%, rgba(255, 255, 255, 0.02) 43%, transparent 45%),
        radial-gradient(ellipse 65% 40% at 55% 45%, transparent 48%, rgba(0, 0, 0, 0.11) 50%, rgba(0, 0, 0, 0.11) 51%, rgba(0, 0, 0, 0.02) 53%, transparent 55%),
        radial-gradient(ellipse 65% 40% at 55% 45%, transparent 58%, rgba(255, 255, 255, 0.09) 60%, rgba(255, 255, 255, 0.09) 61%, rgba(255, 255, 255, 0.02) 63%, transparent 65%),
        radial-gradient(ellipse 65% 40% at 55% 45%, transparent 68%, rgba(0, 0, 0, 0.08) 70%, rgba(0, 0, 0, 0.08) 71%, rgba(0, 0, 0, 0.01) 73%, transparent 75%);
    pointer-events: none;
    z-index: 1;
    animation: wavePulse2 10s ease-in-out infinite;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* ENSURE HERO WAVES STAY CONTAINED */
.hero {
    overflow: hidden !important;
}

/* FORCE HERO OVERFLOW HIDDEN - HIGHEST PRIORITY */
section.hero {
    overflow: hidden !important;
    position: relative !important;
}

/* Contact form 2-column layout on desktop */
.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .contact-form-row {
        grid-template-columns: 1fr;
    }
}

/* Contact form 2-column layout on desktop */
.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .contact-form-row {
        grid-template-columns: 1fr;
    }
}

/* Footer mobile layout */
@media (max-width: 768px) {
    footer div[style*="grid-template-columns: 2fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    footer div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
    }
}

/* Footer mobile - centered with large logo */
@media (max-width: 768px) {
    footer div[style*="grid-template-columns: 2fr 1fr 1fr 1fr"] > div {
        text-align: center !important;
    }
    
    footer img[alt="CSTI Acoustics"] {
        width: 80% !important;
        max-width: 300px !important;
        height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }
    
    footer p, footer ul {
        text-align: center !important;
    }
    
    footer ul {
        display: inline-block !important;
    }
}
