:root {
    --primary-blue: #004a87;
    --light-blue: #7bbce6;
    --dark-grey: #2c3e50;
    --text-grey: #4a5568;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

/* --- RESET & BASICS --- */
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-grey);
    margin: 0;
    padding: 0;
    background-color: var(--white);
}

h1, h2, h3 {
    color: var(--primary-blue);
    margin-top: 0;
    font-weight: 700;
}

/* --- HEADER & NAV --- */
header {
    padding: 1rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo img {
    max-height: 55px;
    display: block;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-grey);
    font-weight: 600;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-blue);
}

/* --- SECTIONS (Unified Padding) --- */
.hero, 
.services, 
.innovation-section, 
.publications-section, 
.contact-section,
.legal-content {
    padding: 5rem 10%;
}

.hero {
    background: linear-gradient(180deg, var(--white) 0%, var(--bg-light) 100%);
    text-align: center;
}

.hero h1 { font-size: 3rem; margin-bottom: 1.5rem; line-height: 1.2; }
.hero p { font-size: 1.25rem; max-width: 800px; margin: 0 auto 2.5rem; color: var(--dark-grey); }

.innovation-section { border-top: 1px solid #e2e8f0; }
.publications-section { background-color: var(--bg-light); border-top: 1px solid #e2e8f0; }

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}
.section-header h2 { font-size: 2.2rem; margin-bottom: 1rem; }

/* --- GRID SYSTEM (Base Mobile Default) --- */
.services, 
.product-grid, 
.publication-grid {
    display: grid;
    gap: 2.5rem;
    width: 100%;
    margin: 0 auto;
    grid-template-columns: 1fr; /* Mobile Default: 1 Column */
    box-sizing: border-box;
}

/* --- SPECIFIC GRID RESPONSIVENESS (Restored) --- */

/* 1. Services & Publications: 2 columns at 700px */
@media (min-width: 700px) {
    .services, .publication-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 2. Products (Tools): 2 columns at 1000px (Centered) */
@media (min-width: 1000px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
    }
}

/* 3. Services: 4 columns ONLY at 1600px+ (The "Perfect" Wide Layout) */
@media (min-width: 1600px) {
    .services {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1800px;
    }
}


/* --- CARD STYLES --- */
.service-card, 
.product-card, 
.pub-card {
    background: var(--white);
    border: 1px solid #e2e8f0; 
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.service-card:hover, 
.product-card:hover, 
.pub-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--light-blue);
}

.service-card h3, 
.product-card h3, 
.pub-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--dark-grey);
}

.service-card p, 
.product-card p, 
.pub-card p {
    color: var(--text-grey);
    margin-bottom: 1rem;
}

/* Card Visuals */
.service-card::before, .product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--light-blue));
}

.pub-card {
    border-top: 4px solid var(--primary-blue);
    padding: 2rem;
}
.pub-card:hover { border-top-color: var(--light-blue); }

.pub-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--light-blue);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.pub-card::after {
    content: '→';
    margin-top: auto;
    padding-top: 1rem;
    font-weight: bold;
    color: var(--light-blue);
    align-self: flex-end; 
    transition: var(--transition);
}
.pub-card:hover::after { transform: translateX(5px); color: var(--primary-blue); }

/* --- ICONS & BUTTONS --- */
.icon-container {
    width: 50px; height: 50px;
    background-color: #f0f7fc;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
}
.icon-container svg { width: 28px; height: 28px; fill: var(--primary-blue); }

.btn-cta, .btn-text {
    font-weight: 700; text-decoration: none; transition: var(--transition);
    display: inline-block;
}

.btn-cta {
    background-color: var(--white);
    color: var(--primary-blue);
    padding: 1rem 2.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 0.95rem;
    border: 2px solid var(--white);
}
.btn-cta:hover {
    background-color: var(--light-blue);
    border-color: var(--light-blue);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-text { color: var(--primary-blue); margin-top: auto; }
.btn-text:hover { color: var(--light-blue); transform: translateX(5px); }

/* --- FOOTER & CONTACT --- */
.contact-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #003865 100%);
    color: var(--white); text-align: center;
}
.contact-section h2 { color: var(--white); }
.contact-section p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 2.5rem; }

footer {
    padding: 2rem 10%; text-align: center; font-size: 0.9rem;
    border-top: 1px solid #eee; background-color: var(--bg-light); color: #718096;
}
footer a { color: var(--primary-blue); text-decoration: none; }

/* --- MOBILE OPTIMIZATION (Fixing padding issues) --- */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 1rem; padding: 1rem 5%; }
    .main-nav ul { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .hero h1 { font-size: 2rem; }
    
    /* Ensure ALL sections have identical padding on mobile */
    .hero, 
    .services, 
    .innovation-section, 
    .publications-section, 
    .contact-section,
    .legal-content {
        padding: 3rem 5%;
    }
}

/* This removes the "double padding" that makes the Tools cards too narrow */
#tools .product-grid,
#tools .services {
    padding: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    max-width: none !important;
}

/* Ensure the grid gap handles the spacing, not the container */
#tools .product-grid {
    display: grid;
    gap: 2.5rem;
}