/* --- Core System Variables & Architectural Foundations --- */
:root {
    --bg-main: #0b111e;
    --bg-card: #141c2f;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --text-white: #ffffff;
    --text-muted: #cbd5e1;
    --border-line: rgba(255, 255, 255, 0.05);
    --transition-engine: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Navigation Header Configurations (Dynamic State Matrix) --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    background: transparent; /* Starts transparent at the very top */
    border-bottom: 1px solid transparent;
    transition: var(--transition-engine);
}

/* Base Navbar Text Colors (When background is transparent/dark at top) */
.navbar .logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff !important; /* Sharp white text at startup */
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition-engine);
}
.navbar .logo span { 
    color: var(--accent-red) !important; 
}

.nav-links { display: flex; list-style: none; gap: 32px; }
.nav-links a { 
    text-decoration: none; 
    color: rgba(255, 255, 255, 0.8) !important; /* Silver-white links at startup */
    font-weight: 600; 
    transition: var(--transition-engine); 
}
.nav-links a:hover, .nav-links a.active { 
    color: var(--accent-red) !important; 
}

.nav-container {
    max-width: 1300px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 4%;
}

/* Scroll Active Rules: Changes layout styles when JavaScript modifies background inline */
.navbar[style*="background: rgb(255, 255, 255)"],
.navbar[style*="background: #ffffff"],
.navbar[style*="background: white"] {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* Flips the logo title text to a deep dark slate when background is white */
.navbar[style*="background: rgb(255, 255, 255)"] .logo,
.navbar[style*="background: #ffffff"] .logo,
.navbar[style*="background: white"] .logo {
    color: #141c2f !important; 
}

/* Flips the nav menu links to clear dark gray when background is white */
.navbar[style*="background: rgb(255, 255, 255)"] .nav-links a,
.navbar[style*="background: #ffffff"] .nav-links a,
.navbar[style*="background: white"] .nav-links a {
    color: #475569 !important;
}

/* Keeps active & hovered links flashing red over the white background state */
.navbar[style*="background: rgb(255, 255, 255)"] .nav-links a:hover,
.navbar[style*="background: rgb(255, 255, 255)"] .nav-links a.active,
.navbar[style*="background: #ffffff"] .nav-links a:hover,
.navbar[style*="background: #ffffff"] .nav-links a.active,
.navbar[style*="background: white"] .nav-links a:hover,
.navbar[style*="background: white"] .nav-links a.active {
    color: var(--accent-red) !important;
}

/* --- Action Elements & Buttons --- */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border: none;
    text-align: center;
    transition: var(--transition-engine);
}

.btn-primary { background: var(--accent-red); color: white; }
.btn-primary:hover { background: var(--accent-red-hover); transform: translateY(-1px); }
.btn-outline { border: 2px solid var(--text-muted); color: var(--text-white); background: transparent; }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.04); }
.btn-large { padding: 14px 34px; font-size: 1rem; }
.btn-full { width: 100%; display: block; margin-top: 10px; }

.badge {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 24px;
}

/* --- Cinematic Landing Showcase Layout --- */
.hero {
    position: relative;
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #1e2942 0%, #0b111e 75%);
    padding: 0 4%;
}

.hero-content { max-width: 850px; z-index: 10; margin-top: 60px; }
.hero-content h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 800; line-height: 1.15; margin-bottom: 24px; letter-spacing: -1px; color: #ffffff; }
.hero-content p { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--text-muted); margin-bottom: 38px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; }

/* --- Subpage Banner Framework --- */
.page-title-banner {
    padding: 160px 4% 60px;
    background: linear-gradient(to bottom, #141c2f 0%, #0b111e 100%);
    text-align: center;
}
.page-title-banner h1 { font-size: 3rem; font-weight: 800; margin-bottom: 15px; color: #ffffff; }
.page-title-banner p { color: var(--text-muted); font-size: 1.1rem; }

/* --- High-End Performance Grid System --- */
.matrix-section { max-width: 1300px; margin: auto; padding: 60px 4% 100px; }
.section-header { margin-bottom: 50px; }
.section-header h2 { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; color: #ffffff; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

.matrix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }
.matrix-card { background: var(--bg-card); border: 1px solid var(--border-line); padding: 35px; border-radius: 16px; transition: var(--transition-engine); display: flex; flex-direction: column; }
.matrix-card:hover { transform: translateY(-6px); border-color: rgba(239, 68, 68, 0.25); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }

/* --- PRECISE 40% SCALE MEDIUM SIZING RULES --- */
.image-wrapper {
    width: 100% !important;
    height: 180px !important; 
    background: #ffffff; /* Crisp white display layout inside product cards */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    overflow: hidden;
    padding: 25px !important; 
}

.image-wrapper img {
    width: auto !important;
    height: auto !important;
    max-width: 45% !important;  /* Centers images inside a balanced footprint */
    max-height: 130px !important; 
    object-fit: contain !important; /* Preserves pixel structure perfectly without distortion */
    transition: var(--transition-engine);
}
.matrix-card:hover .image-wrapper img { transform: scale(1.05); }

.matrix-card h3 { font-size: 1.35rem; margin-bottom: 12px; font-weight: 700; color: #ffffff; }
.matrix-card p { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; flex-grow: 1; }

.btn-sm, .inquiry-link { color: var(--accent-red); text-decoration: none; font-weight: 600; font-size: 0.95rem; display: inline-block; transition: var(--transition-engine); }
.btn-sm:hover, .inquiry-link:hover { color: white; transform: translateX(4px); }

/* --- Catalog Headers & Specific Lists --- */
.category-header { margin-bottom: 30px; margin-top: 60px; }
.category-header h2 { font-size: 1.8rem; font-weight: 700; color: var(--text-white); }
.category-divider { border: none; height: 3px; width: 60px; background: var(--accent-red); margin-top: 10px; }
.product-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--accent-red); letter-spacing: 0.5px; margin-bottom: 8px; display: inline-block; }

.specs-list { list-style: none; text-align: left; margin-bottom: 25px; font-size: 0.9rem; }
.specs-list li { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.03); color: var(--text-muted); }
.specs-list li strong { color: var(--text-white); }

/* --- About Segment Framework --- */
.about-split-section { max-width: 1300px; margin: auto; padding: 60px 4% 120px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { font-size: 2.2rem; margin-bottom: 20px; color: #ffffff; }
.about-text p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 30px; }
.about-stats { display: flex; gap: 40px; }
.stat-node strong { display: block; font-size: 2.5rem; color: var(--accent-red); font-weight: 850; }
.stat-node span { color: var(--text-muted); font-size: 0.9rem; }
.about-visual img { width: 100%; border-radius: 16px; border: 1px solid var(--border-line); }

/* --- Production Portal Form Controls --- */
.portal-form-section { padding: 80px 4% 120px; display: flex; justify-content: center; }
.form-wrapper-card { background: var(--bg-card); border: 1px solid var(--border-line); padding: 50px; border-radius: 20px; width: 100%; max-width: 650px; }
.form-wrapper-card h2 { font-size: 2rem; margin-bottom: 10px; text-align: center; color: #ffffff; }
.form-wrapper-card p { color: var(--text-muted); text-align: center; margin-bottom: 35px; }

form input, form select, form textarea {
    width: 100%;
    padding: 15px;
    background: var(--bg-main);
    border: 1px solid var(--border-line);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: var(--transition-engine);
}
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--accent-red); }
form select { cursor: pointer; color: var(--text-muted); }

/* --- Responsive Layout Handlers --- */
@media (max-width: 968px) {
    .about-split-section { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 768px) {
    .nav-links, .nav-actions { display: none; }
    .hero-cta { flex-direction: column; }
    .form-wrapper-card { padding: 30px; }
}