/* =========================================
   1. CORE VARIABLES & RESET
   ========================================= */
:root {
    /* High Contrast & Professional Palette */
    --bg-body: #ffffff;
    --bg-alt: #f8f9fa;
    --text-main: #212529;
    
    /* CHANGED: Darkened from #6c757d to #4a4a4a to fix Contrast Error */
    --text-muted: #4a4a4a; 
    
    --primary: #0066cc; /* Clean Blue */
    --primary-hover: #004c99;
    --border: #e0e0e0;
    --radius: 6px;
    --spacing: 1rem;
    --max-width: 760px; /* Readability constrained */
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    /* SYSTEM FONTS - Fastest possible load time */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   2. LAYOUT UTILITIES
   ========================================= */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }

/* =========================================
   3. HEADER
   ========================================= */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    background: #fff;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
}
.logo span { color: var(--primary); }

.site-header nav a {
    margin-left: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}
.site-header nav a:hover { color: var(--primary); }

/* =========================================
   4. HERO & SECTIONS
   ========================================= */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}
.hero-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 auto;
    max-width: 500px;
}

.btn-hero {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
}
.btn-hero:hover { background: var(--primary-hover); }

.category-section { padding: 2rem 0; }
.alt-bg { background-color: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* =========================================
   5. GRID SYSTEM (Mobile Performance)
   ========================================= */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default mobile: 1 column */
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 600px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr); /* Tablet/Desktop: 2 columns */
    }
}

.tool-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: block;
    transition: transform 0.2s, border-color 0.2s;
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.tool-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary);
}
.tool-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}
.btn-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

/* =========================================
   6. CALCULATOR INPUTS (Global Style)
   ========================================= */
/* Use these classes inside your calculator folders */
.calc-form label {
    display: block;
    font-weight: 600;
    margin: 1rem 0 0.4rem;
    font-size: 0.9rem;
}
.calc-form input, .calc-form select {
    width: 100%;
    padding: 12px; /* Large touch target */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px; /* Prevents iOS Zoom */
    background: #fff;
}
.calc-form button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 14px;
    background: var(--primary);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
}
.calc-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e6f0ff;
    border-radius: var(--radius);
    text-align: center;
    font-weight: bold;
    min-height: 60px; /* Prevents Layout Shift (CLS) */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   7. FOOTER & SEO CONTENT
   ========================================= */
.seo-content {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

footer {
    text-align: center;
    padding: 2rem 0;
    background: var(--bg-alt);
    margin-top: auto;
    border-top: 1px solid var(--border);
}
.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.footer-nav a {
    color: var(--text-muted);
    font-size: 0.85rem;
}
footer p {
    /* CHANGED: Removed #999 to use the darker variable */
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}