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

:root {
    /* Industrial Wargaming Palette */
    --concrete-dark: #1a1a1a;
    --concrete-medium: #2a2a2a;
    --concrete-light: #3a3a3a;
    --steel-gray: #4a4a4a;
    --rust-primary: #c45a2a;
    --rust-dark: #a84a1f;
    --rust-light: #d67a3a;
    --industrial-green: #5a6d33;
    --industrial-green-dark: #4a5d23;
    --text-light: #f5f5f5;
    --text-gray: #b0b0b0;
    --text-muted: #888888;
    --bg-dark: #151515;
    --bg-card: #252525;
    --border-color: #3a3a3a;
    --border-accent: #5a5a5a;
    --shadow-dark: rgba(0, 0, 0, 0.5);
    --shadow-rust: rgba(196, 90, 42, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(196, 90, 42, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(90, 109, 51, 0.05) 0%, transparent 50%);
    color: var(--text-light);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(42, 42, 42, 0.03) 2px,
            rgba(42, 42, 42, 0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

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

/* Navigation */
.navbar {
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(12px);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--rust-primary);
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    position: relative;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.logo-text {
    display: none; /* Hide text on desktop, logo SVG contains text */
}

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

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

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--rust-primary);
    position: relative;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--rust-primary);
}

/* Hero Section */
.hero {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    min-height: 70vh;
}

.hero-content {
    animation: fadeInUp 0.8s;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-light);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--rust-light);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-image {
    animation: fadeInRight 0.8s;
}

.hero-image-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    box-shadow: 0 12px 40px var(--shadow-dark);
    object-fit: cover;
}

.image-placeholder {
    background: linear-gradient(135deg, var(--concrete-medium) 0%, var(--concrete-dark) 100%);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rust-primary), transparent);
}

.image-placeholder svg {
    width: 100px;
    height: 100px;
    opacity: 0.5;
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--rust-primary);
    color: var(--text-light);
    padding: 1.1rem 2.5rem;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-rust);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    background: var(--rust-light);
    box-shadow: 0 6px 25px var(--shadow-rust);
    border-color: var(--rust-light);
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid var(--rust-primary);
    color: var(--rust-primary);
    box-shadow: none;
}

.cta-button.secondary:hover {
    background: var(--rust-primary);
    color: var(--text-light);
    box-shadow: 0 6px 25px var(--shadow-rust);
}

.cta-button.large {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
}

/* Features Section */
.features {
    padding: 5rem 2rem;
    background: var(--concrete-dark);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rust-primary), transparent);
}

.section-title {
    text-align: center;
    font-size: 2.75rem;
    margin-bottom: 4rem;
    color: var(--text-light);
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--rust-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    padding: 2.5rem 2rem;
    border-radius: 0;
    text-align: center;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--rust-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(196, 90, 42, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--rust-primary);
    box-shadow: 0 12px 40px var(--shadow-dark);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--rust-primary);
    font-weight: 700;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-card p {
    color: var(--text-gray);
}

/* Product Showcase */
.product-showcase {
    padding: 5rem 2rem;
    background: var(--bg-dark);
    position: relative;
}

.showcase-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.showcase-image-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    box-shadow: 0 12px 40px var(--shadow-dark);
    object-fit: cover;
}

.showcase-text h3 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    color: var(--rust-primary);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.showcase-text p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.benefits-list {
    list-style: none;
    margin-bottom: 2.5rem;
}

.benefits-list li {
    padding: 0.75rem 0;
    color: var(--text-light);
    font-size: 1.1rem;
    padding-left: 1.5rem;
    position: relative;
    border-left: 2px solid var(--rust-primary);
    margin-bottom: 0.5rem;
}

.benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--rust-primary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* CTA Section */
.cta-section {
    padding: 5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--concrete-dark) 0%, var(--concrete-medium) 100%);
    position: relative;
    border-top: 2px solid var(--rust-primary);
    border-bottom: 2px solid var(--rust-primary);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(196, 90, 42, 0.03) 10px,
            rgba(196, 90, 42, 0.03) 20px
        );
    pointer-events: none;
}

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

.cta-section p {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: var(--concrete-dark);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 2px solid var(--rust-primary);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.footer-note {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Products Page */
.products-header {
    padding: 4rem 2rem 3rem;
    text-align: center;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--rust-primary);
}

/* Category Filters */
.category-filters {
    padding: 2rem;
    background: rgba(15, 15, 30, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: var(--rust-primary);
    border-color: var(--rust-primary);
    transform: translateY(-2px);
    color: var(--text-light);
}

.filter-btn.active {
    background: var(--rust-primary);
    border-color: var(--rust-primary);
    color: var(--text-light);
}

/* Category Sections */
.category-section {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 2rem;
    color: var(--rust-primary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--rust-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-count {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: normal;
}

.category-section.hidden {
    display: none;
}

.products-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.products-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
}

.products-grid-section {
    padding: 3rem 2rem;
    background: var(--concrete-dark);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--bg-card);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--rust-primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--rust-primary);
    box-shadow: 0 12px 40px var(--shadow-dark);
}

.product-image-container {
    width: 100%;
    height: 250px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    color: var(--text-gray);
    text-align: center;
    padding: 2rem;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    color: var(--rust-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.product-info p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.viewer-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    opacity: 0.7;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.product-card:hover .viewer-indicator {
    opacity: 1;
    background: rgba(196, 90, 42, 0.8);
    transform: scale(1.1);
}

.viewer-indicator svg {
    width: 18px;
    height: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    padding-top: 90px; /* Account for navbar on desktop (1.25rem + 50px logo + 1.25rem) */
}

.modal-content {
    background: var(--bg-card);
    border-radius: 0;
    width: 90%;
    max-width: 900px;
    max-height: calc(100vh - 90px); /* Adjust for navbar */
    position: relative;
    border: 2px solid var(--rust-primary);
    box-shadow: 0 20px 60px var(--shadow-dark);
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: auto;
}

.close {
    position: sticky;
    right: 0;
    top: 0;
    color: var(--text-light);
    cursor: pointer;
    z-index: 100;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transition: background 0.3s, transform 0.3s;
    padding: 0;
    margin: 12px 12px 0 auto;
    border: none;
    outline: none;
    flex-shrink: 0;
    align-self: flex-end;
}

.close svg {
    width: 20px;
    height: 20px;
    display: block;
}

.close:hover {
    background: var(--rust-primary);
    transform: rotate(90deg);
}

.modal-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h2 {
    color: var(--rust-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1.2rem;
    margin: 0;
}

.model-viewer-container {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#modelViewer {
    width: 100%;
    height: 500px;
    background: var(--bg-dark);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: var(--text-light);
    width: 80%;
    max-width: 300px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(233, 69, 96, 0.2);
    border-top-color: var(--rust-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.loading-bar {
    height: 100%;
    background: var(--rust-primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.loading-percentage {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin: 0;
}

.viewer-controls {
    margin-top: 1rem;
    text-align: center;
}

.viewer-hint {
    color: var(--text-gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.reset-view-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--rust-primary);
    border: 2px solid var(--rust-primary);
    border-radius: 0;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.reset-view-btn:hover {
    background: var(--rust-primary);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-rust);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .showcase-content {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 1rem;
    }

    /* Mobile Modal Improvements */
    .modal.active {
        align-items: flex-start;
        padding: 0;
        padding-top: 0; /* No padding on mobile since navbar is hidden */
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        min-height: 100vh;
        border: none;
        border-radius: 0;
        margin: 0;
        padding-top: 0;
    }

    .close {
        position: fixed;
        top: 12px; /* Top position since navbar is hidden */
        right: 12px;
        margin: 0;
        width: 48px;
        height: 48px;
        background: rgba(196, 90, 42, 0.9);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        z-index: 3001;
    }

    .modal-header {
        padding: 1rem;
        padding-top: 1rem;
        padding-right: 4rem;
    }

    .modal-header h2 {
        font-size: 1rem;
        word-break: break-word;
    }

    .model-viewer-container {
        padding: 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #modelViewer {
        height: 50vh;
        min-height: 300px;
        max-height: 60vh;
    }

    .viewer-controls {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .viewer-hint {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .reset-view-btn {
        width: 100%;
        padding: 1rem;
        font-size: 0.9rem;
    }
}

