:root {
    /* Blue Corporate Theme - High Contrast, Accessible */
    --color-primary: #0056b3;       /* Classic Link Blue */
    --color-primary-hover: #004494;
    --color-primary-bg: #e7f1ff;    /* Light blue background for accents */
    
    --color-text-main: #212529;     /* Gray 900 - High contrast */
    --color-text-muted: #495057;    /* Gray 700 */
    --color-text-light: #6c757d;    /* Gray 600 */
    
    --color-bg-body: #ffffff;
    --color-bg-alt: #f8f9fa;        /* Light Gray Section Background */
    --color-bg-white: #ffffff;

    --color-border: #dee2e6;
    
    /* Status Colors */
    --color-success-bg: #d1e7dd;
    --color-success-text: #0f5132;
    --color-error-bg: #f8d7da;
    --color-error-text: #842029;

    /* Spacing */
    --container-width: 1140px;
    --header-height: 70px;
    --radius: 4px;
    
    /* System Fonts - Maximum Performance */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6; /* Improved readability */
    color: var(--color-text-main);
    background-color: var(--color-bg-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-main);
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; margin-bottom: 1.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p { margin-bottom: 1.25rem; max-width: 100%; }

ul, ol { margin-bottom: 1.25rem; padding-left: 2rem; }
li { margin-bottom: 0.5rem; }

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--container-width);
    padding-right: 20px;
    padding-left: 20px;
    margin-right: auto;
    margin-left: auto;
}

main {
    flex: 1;
    /* Key Fixes: Global spacing to prevent header/footer collisions */
    padding-top: 3rem;
    padding-bottom: 5rem;
}

.mb-8 { margin-bottom: 4rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

/* Header */
.site-header {
    background-color: #fff;
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02); /* Subtle separation */
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
    color: var(--color-text-main);
    cursor: pointer;
}

/* Hero Section (Home) */
/* Special case: Hero needs to sit flush against header, so we pull it up */
.hero {
    margin-top: -3rem; /* Counteract main padding-top */
    padding: 5rem 0 4rem;
    background-color: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    color: #111;
    font-size: 3rem;
    margin-bottom: 1.25rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--radius);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 86, 179, 0.15);
}

.btn-primary:hover {
    color: #fff;
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 86, 179, 0.2);
    text-decoration: none;
}

.btn-secondary {
    color: var(--color-text-main);
    background-color: #fff;
    border-color: var(--color-border);
}

.btn-secondary:hover {
    color: var(--color-text-main);
    background-color: var(--color-bg-alt);
    border-color: #c6c7c8;
    text-decoration: none;
}

/* Tool Cards */
.tool-category {
    margin-bottom: 4rem;
}

.category-header {
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.category-header h2 {
    font-size: 1.5rem;
    margin: 0;
    display: inline-block;
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: -0.6rem; /* Overlap border */
    padding-bottom: 0.6rem;
    color: var(--color-text-main);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
    height: 100%;
}

.tool-card:hover {
    text-decoration: none;
    border-color: var(--color-primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.tool-card h3 {
    font-size: 1.15rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.tool-card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 0;
    line-height: 1.5;
    flex-grow: 1;
}

/* Content Sections */
.content-section {
    padding: 0; /* Padding handled by main/container now */
    max-width: 100%;
    margin: 0;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

/* Forms & Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border-color: #badbcc;
}

.alert-error {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
    border-color: #f5c6cb;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-main);
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out;
}

input:focus, textarea:focus {
    border-color: var(--color-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* Footer */
.site-footer {
    background-color: #f8f9fa;
    border-top: 1px solid var(--color-border);
    padding: 4rem 0 2rem;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--color-text-light);
    margin-bottom: 1.25rem;
}

.footer-col ul {
    list-style: none;
    padding-left: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--color-text-muted);
}

.footer-col a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    color: var(--color-text-light);
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    main {
        padding-top: 2rem; /* Smaller padding on mobile */
    }
    .hero {
        margin-top: -2rem;
        padding: 3rem 0;
    }
    .hero h1 { font-size: 2.25rem; }
    
    .nav-links { 
        display: none; 
        position: absolute;
        top: var(--header-height); left: 0; right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1.5rem;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        gap: 1rem;
    }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
}
