/* --- VARIABLES & THEME --- */
:root {
    /* Color Palette - "Dark Venture" */
    --bg-body: #050507;        /* Almost black, very deep charcoal */
    --bg-surface: #0E0E11;     /* Slightly lighter for cards */
    --bg-surface-hover: #16161C;
    
    --text-primary: #EDEDF0;
    --text-secondary: #A0A0AC;
    --text-tertiary: #52525B;

    /* Accents */
    --accent-primary: #ee7867; /* Strategic Coral */
    --accent-success: #4ade80; /* Green - Free/Open Source */
    --accent-glow: rgba(238, 120, 103, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(255, 255, 255, 0.15);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;

    /* Spacing */
    --container-width: 1000px; /* Tighter, more editorial width */
    --header-height: 70px;
    
    --bg-header: rgba(5, 5, 7, 0.85);
    --bg-mobile-menu: rgba(5, 5, 7, 0.95);

    --text-gradient-bg: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    --text-article: #D4D4D8;
}

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

ul { list-style: none; }

/* --- UTILITIES --- */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.text-gradient {
    background: var(--text-gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-success {
    color: var(--accent-success);
}

.fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

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

.main-nav a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--text-primary);
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    padding: 180px 0 120px;
    text-align: center;
}

/* Subtle glow behind text */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw; /* Prevent overflow on mobile */
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem; /* Large editorial title */
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 3rem;
    font-weight: 400;
}

/* --- CARDS & GRIDS --- */
.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: block;
    font-weight: 600;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    border-radius: 8px; /* Sharper corners for "Business" feel */
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--border-active);
    background: var(--bg-surface-hover);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* Deep Dive Specifics */
.article-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.article-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: auto; /* Pushes meta to bottom */
    padding-bottom: 1.5rem;
}

.meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    margin-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Market Notes (Smaller cards) */
.market-note {
    background: transparent;
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
}

.market-note h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.market-note p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- FORMS (Newsletter) --- */
.newsletter-inline {
    display: flex;
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

.input-field {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 12px 16px;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 12px 24px; /* Fixed: Added vertical padding */
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* --- TOOLS DIRECTORY STYLES --- */
.tool-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s;
    text-decoration: none;
}

.tool-row:last-child {
    border-bottom: none;
}

.tool-row:hover {
    background: var(--bg-surface-hover);
}

.tool-row-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 2;
}

.tool-row h4 { 
    font-size: 1.1rem; 
    color: var(--text-primary);
    margin: 0;
}

.tool-desc {
    font-size: 0.95rem; 
    color: var(--text-secondary); 
    flex: 3;
    padding: 0 1rem;
}

.tool-meta {
    font-size: 0.9rem; 
    color: var(--text-tertiary);
    text-align: right;
    min-width: 80px;
}

.tool-badge {
    font-size: 0.7rem; 
    background: rgba(238, 120, 103, 0.1); 
    color: var(--accent-primary); 
    padding: 4px 8px; 
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pill-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pill-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.pill-btn.active {
    background: var(--bg-surface);
    border-color: var(--accent-primary);
    color: var(--text-primary);
} 

/* --- ARTICLE PAGE TYPOGRAPHY --- */
.article-body {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-article); /* Slightly softer white for reading */
    max-width: 680px;
    margin: 0 auto;
}

.article-body p { margin-bottom: 1.5rem; }
.article-body h2 { 
    font-family: var(--font-sans); 
    font-size: 1.75rem; 
    margin: 2.5rem 0 1rem; 
    color: var(--text-primary);
}
.article-body blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* --- ARTICLE & TOOL DETAIL --- */
.tool-detail-header, .compare-header {
    padding: 120px 0 60px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.tool-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
}

.tool-detail-content, .compare-content {
    padding: 60px 0 100px;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-article);
}

.tool-detail-content .container, .compare-content .container {
    max-width: 800px;
}

.tool-detail-content p, .compare-content p,
.tool-detail-content ul, .compare-content ul {
    margin-bottom: 1.5rem;
}

.tool-detail-content h2, .compare-content h2,
.tool-detail-content h3, .compare-content h3 {
    font-family: var(--font-sans);
}

.tool-detail-content h2, .compare-content h2 {
    font-size: 1.75rem;
    margin: 3rem 0 1.25rem;
    color: var(--text-primary);
}

.tool-detail-content h3, .compare-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.tool-detail-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.tool-detail-content li {
    margin-bottom: 0.5rem;
}

/* Quick Facts Grid */
.quick-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.quick-fact {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.quick-fact-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-fact-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Comparison Table */
.compare-table-wrapper {
    overflow-x: auto;
    margin-bottom: 3rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    min-width: 600px; /* Force scroll on small mobile */
}

.compare-table th, .compare-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.compare-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface-hover);
}

.compare-table td {
    color: var(--text-primary);
}

.compare-table .winner {
    color: var(--accent-success);
    font-weight: 600;
}

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

/* --- FOOTER --- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 4rem 0;
    margin-top: 6rem;
    background: var(--bg-surface);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
}

.footer-col h5 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text-primary); }

/* --- LIGHT THEME --- */
@media (prefers-color-scheme: light) {
    :root {
        --bg-body: #ffffff;
        --bg-surface: #f4f4f5;
        --bg-surface-hover: #e4e4e7;
        
        --text-primary: #18181b;
        --text-secondary: #52525b;
        --text-tertiary: #71717a;

        --bg-header: rgba(255, 255, 255, 0.85);
        --bg-mobile-menu: rgba(255, 255, 255, 0.95);

        --border-subtle: rgba(0, 0, 0, 0.08);
        --border-active: rgba(0, 0, 0, 0.15);
        
        --accent-glow: rgba(238, 120, 103, 0.1);

        --text-gradient-bg: linear-gradient(135deg, #18181b 0%, #52525b 100%);
        --text-article: #3f3f46;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero { padding: 120px 0 80px; }
    .hero h1 { font-size: 2.5rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    
    /* Mobile Navigation */
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--bg-mobile-menu);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-subtle);
        padding: 1.5rem;
    }

    .main-nav.is-open {
        display: block;
        animation: fadeIn 0.2s ease;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1.5rem;
    }

    .main-nav a {
        display: block;
        font-size: 1.1rem;
    }

    .menu-toggle { display: block; }

    /* Mobile Tools Layout */
    .tool-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .tool-row-main {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0.25rem;
    }

    .tool-desc {
        padding: 0;
        font-size: 0.9rem;
    }

    .tool-meta {
        text-align: left;
        width: 100%;
        font-size: 0.85rem;
        color: var(--accent-primary);
    }

    .article-body, .tool-detail-content .container, .compare-content .container {
        padding: 0 1.5rem;
    }
}

/* Mobile Toggle */
.menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}