/* Everett Engineering - Optimized Main CSS */
:root {
    --primary: #1B3A57;
    --secondary: #2C5282;
    --accent: #3182CE;
    --brand-accent: #E53E3E;
    --light-bg: #FFFFFF;
    --text: #1A202C;
    --light-text: #4A5568;
    --max-width: 1200px;
    --bright-blue: #4299E1;
    --bright-orange: #FF6B35;
    --success-green: #38A169;
}

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

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

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background: white !important;
    overflow-x: hidden;
}

/* Touch-friendly tap targets */
a:not(.logo a), button, input, textarea, select {
    -webkit-tap-highlight-color: rgba(193, 68, 14, 0.2);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo a {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--bright-blue) 100%);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 25px rgba(0,0,0,0.15);
    border-bottom: 2px solid var(--bright-orange);
}

.nav {
    max-width: var(--max-width);
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: white;
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
    letter-spacing: -0.02em;
}

.logo span {
    color: rgba(255,255,255,0.8);
    font-size: 0.7rem;
    font-weight: 400;
    display: block;
    margin-top: -2px;
}

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

.nav-menu a, .dropdown-toggle {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 1.8rem;
    cursor: pointer;
    min-height: 44px;
}

.nav-menu a:hover, .nav-menu a.active, .dropdown-toggle:hover {
    color: white;
    background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 280px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    border: 1px solid rgba(0,0,0,0.1);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.7rem 1.2rem;
    margin: 0;
    color: var(--text);
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    text-transform: none;
    letter-spacing: normal;
    background: transparent;
    transform: none;
    min-height: auto;
}

.dropdown-menu a:hover {
    background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent)) !important;
    color: white !important;
    padding-left: 1.5rem;
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: none;
    min-height: 44px;
    min-width: 44px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    padding: 0;
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    color: #fff;
}

.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.4rem;
    margin-bottom: 3rem;
    font-weight: 400;
    line-height: 1.5;
    max-width: 700px;
    color: rgba(255, 255, 255, 0.9);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 2px solid rgba(52, 152, 219, 0.8);
}

.hero-stat {
    text-align: left;
}

.hero-stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    display: block;
    line-height: 1;
}

.hero-stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* About Section */
.about-section {
    padding: 0;
}

.section-band {
    width: 100%;
    padding: 4rem 2rem;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
}

.section-band:first-child {
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0.9) 100%);
    padding-top: 8rem;
    margin-top: 2rem;
}

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    color: #2C3E50;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
}

.section-text {
    font-size: 1.2rem;
    color: #333;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.services-grid .service-card:nth-child(4) {
    grid-column: 1 / 2;
    justify-self: end;
}

.services-grid .service-card:nth-child(5) {
    grid-column: 3 / 4;
    justify-self: start;
}

.services-grid .service-card:nth-child(6) {
    grid-column: 1 / 2;
    justify-self: end;
}

.services-grid .service-card:nth-child(7) {
    grid-column: 3 / 4;
    justify-self: start;
}

.vertical-info-card {
    grid-column: 2;
    grid-row: 2 / 4;
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(0, 0, 0, 0.6)), url('../images/home-vertical-card.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 0 1rem;
}

.vertical-info-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.vertical-info-card p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.vertical-info-card .cta-btn {
    background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent));
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    min-height: auto;
}

.vertical-info-card .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.service-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 450px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent));
    z-index: 2;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border-color: var(--bright-orange);
}

.service-card:hover::before {
    height: 6px;
    background: linear-gradient(135deg, var(--brand-accent), var(--bright-orange));
}

.service-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

.service-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    order: 1;
}

.service-content .service-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    order: 2;
    margin-bottom: 1rem;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    loading: lazy;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-desc {
    font-size: 0.95rem;
    color: var(--light-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    order: 3;
}

.read-more-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent));
    color: white;
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    align-self: flex-start;
    order: 4;
    min-height: auto;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, var(--brand-accent), var(--bright-orange));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    min-height: auto;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
    background: linear-gradient(135deg, var(--brand-accent), var(--bright-orange));
}

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

/* Footer */
footer {
    background: rgba(43, 43, 43, 0.9);
    color: #ccc;
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
}

/* Form Optimizations */
input, textarea, select {
    font-size: 16px !important;
    -webkit-appearance: none;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
}

button, .btn-primary {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        position: relative;
    }
    
    .section-band {
        padding: 2rem 1rem;
    }
    
    .section-band:first-child {
        margin-top: -50px;
        padding-top: 3rem;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #e5e5e5;
        z-index: 1001;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu.active {
        display: flex;
        max-height: 500px;
    }
    
    .nav-menu a, .dropdown-toggle {
        margin: 0;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
        color: var(--text) !important;
        background: transparent;
        transform: none;
        text-transform: none;
        letter-spacing: normal;
        border-radius: 0;
        display: block;
        width: 100%;
    }
    
    .nav-menu a:hover, .nav-menu a.active, .dropdown:hover .dropdown-toggle {
        background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent)) !important;
        color: white !important;
        transform: none;
        box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
    }
    
    .dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .dropdown-menu a {
        padding: 12px 30px;
        font-size: 0.8rem;
        background: #f8f9fa;
        border-bottom: 1px solid #e5e5e5;
        color: var(--light-text) !important;
    }
    
    .dropdown-menu a:hover {
        background: linear-gradient(135deg, var(--bright-orange), var(--brand-accent));
        color: white !important;
        padding-left: 30px;
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    }
    
    .hero {
        min-height: 70vh;
        padding: 2rem 1rem;
    }
    
    .hero-container {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .hero-stat-number {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .section-text {
        font-size: 1.1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .services-grid .service-card:nth-child(4),
    .services-grid .service-card:nth-child(5),
    .services-grid .service-card:nth-child(6),
    .services-grid .service-card:nth-child(7) {
        grid-column: 1;
        justify-self: stretch;
    }
    
    .vertical-info-card {
        grid-column: 1;
        grid-row: auto;
        margin: 1rem 0;
        min-height: 200px;
    }
    
    .service-card {
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 1rem;
        min-height: auto;
    }
    
    .service-card:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .service-content {
        padding: 1rem;
    }
    
    .service-image {
        height: 120px;
        margin-bottom: 0.8rem;
    }
    
    .service-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .service-title {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .service-desc {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .read-more-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card, .section-card, .service-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .card, .section-card, .service-card {
        padding: 1rem;
    }
    
    input, textarea, button {
        font-size: 16px;
        padding: 10px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 70vh;
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 2rem;
    }
}

/* Optimized animations for mobile */
@media (prefers-reduced-motion: no-preference) {
    .card, .section-card, .service-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .nav-menu {
        transition: max-height 0.25s ease, opacity 0.2s ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Lazy loading placeholder */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* Responsive images */
@media (max-width: 768px) {
    .service-image img,
    .gallery-images img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}

/* WebP support detection */
.webp .hero {
    background-image: url('../images/factory-workers-industrial-production-hall (1).webp');
}

.no-webp .hero {
    background-image: url('../images/factory-workers-industrial-production-hall (1).jpg');
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img, .icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}