/* =========================================
   CHEMI ENTERPRISE - EMERGENT B2B UI
   ========================================= */

:root {
    --navy-dark: #070B19; 
    --navy-main: #0F172A; 
    --brand-blue: #0A4BB3; 
    --text-main: #334155; 
    --text-muted: #64748B;
    --bg-white: #ffffff;
    --bg-light: #F8FAFC;
    --border-color: #E2E8F0;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

/* FIX: overflow-x clip allows sticky scroll to work while hiding horizontal overflow */
html, body {
    width: 100%;
    overflow-x: clip; 
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background: radial-gradient(circle at 0% 0%, #e0f2fe 0%, transparent 50%),
                radial-gradient(circle at 100% 0%, #fce7f3 0%, transparent 50%);
    background-color: var(--bg-white);
    background-attachment: fixed;
}

/* --- TYPOGRAPHY & UTILITIES --- */
h1, h2, h3, h4, h5, h6 { color: var(--navy-main); }
h1 { font-size: 4.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; margin-bottom: 1.5rem; }
h2 { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 1rem; line-height: 1.2; }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
h4 { color: var(--brand-blue); margin-bottom: 10px; font-size: 1.2rem; }
p { font-size: 1.125rem; color: var(--text-main); }

.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }
.section-padding { padding: 120px 0; overflow: visible; }
.text-center { text-align: center; }
.text-white { color: #ffffff !important; }
.text-light { color: #CBD5E1 !important; }
.text-blue { color: var(--brand-blue) !important; }

.overline-text { 
    text-transform: uppercase; letter-spacing: 2px; font-weight: 600; 
    font-size: 0.85rem; margin-bottom: 20px; color: var(--brand-blue);
}

.text-large { font-size: 3.5rem; line-height: 1.1; margin-bottom: 30px; }
.text-huge { font-size: 4.5rem; line-height: 1.1; max-width: 900px; margin: 0 auto; }
.lead-text { margin-bottom: 30px; font-size: 1.25rem; color: var(--text-muted); }
.spacer-top { margin-top: 40px; }
.spacer-bottom-lg { margin-bottom: 60px; }
.spacer-bottom-xl { margin-bottom: 120px; }
.relative-box { position: relative; }
.z-index-2 { position: relative; z-index: 2; }
.inline-block { display: inline-block; }
.full-width { width: 100%; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.form-row { display: flex; gap: 20px; width: 100%; }

/* --- HEADER & NAVIGATION --- */
.global-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px; position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-color);
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-main); text-decoration: none; text-transform: uppercase; }
.logo-icon { width: 28px; height: 28px; background: var(--brand-blue); display: flex; align-items: center; justify-content: center; color: white; font-size: 0.9rem; }

.mobile-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--navy-main); }

.main-nav { display: flex; align-items: center; gap: 40px; }
/* FIX 1: The ">" ensures only the top-level navigation items sit horizontally */
.main-nav > ul { list-style: none; display: flex; gap: 35px; margin: 0; padding: 0; }
.main-nav a { text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s; }
.main-nav a:hover { color: var(--brand-blue); }

/* --- NAVBAR DROPDOWNS & MEGA MENU --- */
.dropdown { position: relative; }

/* FIX 2: Force the standard dropdown menus to stack vertically */
.dropdown-menu {
    position: absolute; top: 100%; left: -20px; background: var(--bg-white);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08); border: 1px solid var(--border-color);
    border-radius: 4px; padding: 10px 0; min-width: 240px; 
    opacity: 0; pointer-events: none; transform: translateY(15px); 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1001;
    display: flex;
    flex-direction: column; /* This forces the vertical stack */
    gap: 0;
    list-style: none;
}
.dropdown:hover .dropdown-menu { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-menu a { display: block; padding: 12px 24px; color: var(--navy-main); font-weight: 500; transition: all 0.2s; letter-spacing: 0; text-transform: none; width: 100%; }
.dropdown-menu a:hover { background: var(--bg-light); color: var(--brand-blue); padding-left: 30px; }

/* The Emergent Mega Menu */
.mega-menu {
    position: absolute; top: 100%; left: -150px; width: 650px;
    background: var(--bg-white); box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
    border: 1px solid var(--border-color); border-radius: 6px;
    padding: 35px; opacity: 0; pointer-events: none; transform: translateY(15px); 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1001;
    display: flex; gap: 40px; cursor: default;
}
.dropdown:hover .mega-menu { opacity: 1; pointer-events: all; transform: translateY(0); }
.mega-col { flex: 1; display: flex; flex-direction: column; }
.mega-col h4 { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 15px; letter-spacing: 1.5px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.mega-col a { display: block; padding: 8px 0; font-size: 0.95rem; color: var(--navy-main); font-weight: 500; text-transform: none; letter-spacing: 0; transition: all 0.2s; }
.mega-col a:hover { color: var(--brand-blue); transform: translateX(5px); }

/* Chevron for dropdowns */
.nav-arrow { font-size: 0.7rem; margin-left: 4px; vertical-align: middle; color: var(--text-muted); transition: transform 0.2s; display: inline-block; }
.dropdown:hover .nav-arrow { transform: rotate(180deg); color: var(--brand-blue); }

/* Buttons */
.btn { 
    background: var(--brand-blue); color: white; padding: 14px 28px; 
    border: none; border-radius: 4px; font-weight: 600; font-size: 0.9rem; 
    cursor: pointer; text-decoration: none; display: inline-block; 
    transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px;
}
.btn:hover { background: #083A8C; transform: translateY(-2px); box-shadow: 0 8px 15px rgba(10, 75, 179, 0.2); }

.main-nav .btn-nav {
    background: var(--brand-blue); color: var(--bg-white); padding: 10px 20px; 
    border-radius: 4px; font-size: 0.85rem; font-weight: 600; text-decoration: none;
    transition: all 0.3s; text-transform: uppercase; letter-spacing: 1px;
}
.main-nav .btn-nav:hover { background: #083A8C; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(10, 75, 179, 0.2); color: white; }

/* --- HERO SECTION --- */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding-top: 80px; }
.hero-content { max-width: 650px; position: relative; z-index: 2; }
.hero-subtext { margin-bottom: 40px; max-width: 500px; color: var(--text-muted); }

.ticker-wrap { width: 100%; overflow: hidden; background: var(--bg-white); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 15px 0; }
.ticker { display: inline-flex; white-space: nowrap; animation: ticker 25s linear infinite; }
.ticker-item { font-size: 1.2rem; font-weight: 600; padding: 0 40px; text-transform: uppercase; color: var(--brand-blue); letter-spacing: 1px; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* --- FORMS & CARDS --- */
.form-control { width: 100%; padding: 15px 20px; margin-bottom: 20px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 1rem; transition: border-color 0.3s; background: var(--bg-white); }
.form-control:focus { border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 3px rgba(10,75,179,0.1); }

.glass-card { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: 8px; padding: 40px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); transition: transform 0.4s ease; width: 100%; }
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06); border-color: #cbd5e1; }
.blue-card { background: var(--brand-blue); border: none; padding: 60px 40px; }
.blue-card h2, .blue-card p { color: white; }

.grid-3 > div { transition: transform 0.4s ease; }
.grid-3 > div:hover { transform: translateY(-6px); }

/* --- EMERGENT PORTFOLIO CARDS --- */
.portfolio-card {
    background: var(--bg-white); border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; text-decoration: none;
    transition: all 0.3s ease; display: flex; flex-direction: column;
}
.portfolio-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.portfolio-card .card-img { height: 220px; width: 100%; overflow: hidden; }
.portfolio-card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.portfolio-card:hover .card-img img { transform: scale(1.05); }
.portfolio-card .card-info { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.portfolio-card h3 { font-size: 1.3rem; color: var(--navy-main); margin-bottom: 15px; line-height: 1.3; }

/* --- FIX: STICKY SCROLL ANIMATIONS --- */
.sticky-wrapper { display: flex; align-items: flex-start; gap: 60px; position: relative; }
/* align-self: flex-start is the secret to making sticky work inside flexbox! */
.sticky-col { flex: 1; position: sticky; top: 120px; align-self: flex-start; z-index: 10; }
.scroll-col { flex: 1; min-width: 0; }
.feature-block { margin-bottom: 40px; }
.scroll-spacer { height: 100px; }

.scroll-reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); will-change: opacity, transform; }
.scroll-reveal.is-visible { opacity: 1; transform: translateY(0); }
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

.float-element { animation: floating 6s ease-in-out infinite; }
.float-element-delayed { animation: floating 7s ease-in-out infinite; animation-delay: -3s; }
.float-bg-1 { position: absolute; top: 20%; left: 15%; width: 80px; height: 80px; background: rgba(10, 75, 179, 0.05); border-radius: 40px 20px; }
.float-bg-2 { position: absolute; bottom: 30%; right: 20%; width: 120px; height: 120px; background: rgba(10, 75, 179, 0.03); border-radius: 50%; }
@keyframes floating { 0% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-15px) rotate(3deg); } 100% { transform: translateY(0px) rotate(0deg); } }

/* --- DARK FOOTER --- */
.global-footer { background: var(--navy-dark); padding: 80px 40px 40px; font-family: 'Inter', sans-serif; border: none; color: var(--text-muted); }
.footer-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 60px; margin-bottom: 60px; }
.footer-col h4 { font-size: 1rem; font-weight: 600; margin-bottom: 20px; color: var(--bg-white); text-transform: uppercase; letter-spacing: 1px; }
.footer-col p { font-size: 0.95rem; line-height: 1.6; color: #94A3B8; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { text-decoration: none; color: #94A3B8; font-size: 0.95rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--bg-white); }
.footer-form { display: flex; margin-top: 15px; }
.footer-form input { flex: 1; padding: 12px 15px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: white; border-radius: 4px 0 0 4px; outline: none; }
.footer-form button { padding: 12px 20px; background: var(--brand-blue); color: white; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-weight: 600; }
.footer-bottom { max-width: 1400px; margin: 0 auto; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; color: #64748B; font-size: 0.85rem; }

/* =========================================
   10. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 1024px) {
    h1 { font-size: 3.2rem; }
    h2 { font-size: 2.5rem; }
    .text-huge { font-size: 3rem; }
    .mobile-toggle { display: block; }
    .main-nav { 
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: var(--bg-white); padding: 30px 40px; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
        flex-direction: column; align-items: flex-start;
        transform: translateY(-150%); opacity: 0; pointer-events: none;
    }
    .main-nav.active { transform: translateY(0); opacity: 1; pointer-events: all; }
    .main-nav ul { flex-direction: column; gap: 20px; width: 100%; }
    .main-nav .btn-nav { width: 100%; text-align: center; margin-top: 10px; }
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; gap: 40px; }
    .sticky-wrapper { flex-direction: column; gap: 40px; }
    .sticky-col { position: relative; top: 0; width: 100%; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* FIX: Force safe mobile padding to stop edge-to-edge rendering */
    .container { padding-left: 24px !important; padding-right: 24px !important; width: 100%; }
    .section-padding { padding: 80px 0; }
    .glass-card, .blue-card { padding: 40px 24px; }
    
    .form-row { flex-direction: column; gap: 0; }
    .form-control { margin-bottom: 20px; }
    h1 { font-size: 2.5rem; line-height: 1.2; }
    h2 { font-size: 2rem; line-height: 1.2; }
    .text-huge { font-size: 2.2rem; line-height: 1.2; padding: 0 10px; }
    .hero { padding-top: 120px; text-align: center; }
    .hero-content { margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
    .hero-graphic { display: none; } 
    
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .global-header { padding: 15px 24px; }
    .main-nav { padding: 30px 24px; }
    .global-footer { padding: 60px 24px 30px; }
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}