:root {
    --primary: #2d1b19;
    --accent: #c89b6d;
    --accent-hover: #b58a5c;
    --gold: #ffd700;
    --white: #ffffff;
    --bg-app: #fbf9f6;
    --text-main: #2d1b19;
    --text-muted: #6b5c5a;
    --border: #e8e2db;
    --shadow-premium: 0 10px 30px rgba(45, 27, 25, 0.05);
    --shadow-strong: 0 20px 60px rgba(45, 27, 25, 0.12);
    --font-main: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
    --primary: #c89b6d;
    --accent: #ffd700;
    --accent-hover: #ffea00;
    --bg-app: #120d0c;
    --text-main: #fbf9f6;
    --text-muted: #a49694;
    --border: #2d2422;
    --white: #1a1514;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: var(--font-main); 
    background-color: var(--bg-app); 
    color: var(--text-main); 
    line-height: 1.6; 
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* --- Header --- */
.header-main {
    background: var(--white);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
} 

.header-main.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-flex { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { 
    font-size: 1.2rem; 
    font-weight: 950; 
    text-decoration: none; 
    color: var(--text-main); 
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
}
.logo span { color: var(--accent); }

/* Center Navigation Links */
.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link { 
    text-decoration: none; 
    color: var(--text-muted); 
    font-weight: 700; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    transition: 0.3s; 
}
.nav-link:hover, .nav-link.active { color: var(--accent); }

/* Right Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-cta {
    background: var(--accent);
    color: white !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(200, 155, 109, 0.15);
}
.nav-cta:hover { 
    background: var(--accent-hover); 
    transform: scale(1.03); 
    box-shadow: 0 6px 15px rgba(200, 155, 109, 0.25); 
}

.theme-toggle {
    background: var(--border);
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    transition: 0.3s;
}
.theme-toggle:hover { background: var(--accent); color: white; transform: rotate(15deg); }

.hamburger {
    display: none !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 4px;
}

/* --- Hero Section (Centered) --- */
.hero {
    background: linear-gradient(rgba(45, 27, 25, 0.94), rgba(45, 27, 25, 0.94)), url('hero_woodworking.png');
    background-size: cover;
    background-position: center;
    padding: 80px 20px 120px;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.hero-title { font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 950; line-height: 1.15; margin-bottom: 32px; }
.hero-subtitle { font-size: clamp(1rem, 4vw, 1.2rem); margin-bottom: 40px; opacity: 0.9; }

/* --- Trust Bar --- */
.trust-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}
.trust-item { display: flex; align-items: center; gap: 8px; color: var(--accent); }

/* --- Calculator Card --- */
.calculator-section {
    margin-top: -80px;
    position: relative;
    z-index: 10;
}

.calculator-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-width: 500px;
    margin: 0 auto;
}

.input-group { margin-bottom: 20px; }
.input-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; display: block; }
.input-field {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    outline: none;
    transition: 0.3s;
    min-height: 48px;
}
.input-field:focus { border-color: var(--accent); }

.tool-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-app);
    padding: 4px;
    border-radius: 12px;
}
.tool-tab {
    flex: 1;
    padding: 12px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-muted);
}
.tool-tab.active { background: var(--accent); color: white; }

/* Result Box (Normal Flow) */
.result-box {
    margin-top: 25px;
    padding: 24px;
    border-radius: 12px;
    background: var(--primary); /* Deep brown from theme */
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.res-item { display: flex; flex-direction: column; gap: 4px; }
.res-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; opacity: 0.7; }
.res-value { font-size: 1.6rem; font-weight: 950; color: var(--accent); }

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.result-actions button {
    flex: 1;
    min-height: 48px;
    background: var(--bg-app);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.result-actions button:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Formula Box */
.formula-box {
    font-size: 20px;
    text-align: center;
    padding: 24px;
    background: var(--primary);
    color: var(--accent);
    border-radius: 12px;
    margin: 30px 0;
    font-weight: 800;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- Blog Section --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.blog-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: 0.3s;
    box-shadow: var(--shadow-premium);
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-strong); }
.blog-content { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.blog-content h4 { margin-bottom: 12px; font-weight: 900; color: var(--primary); }
.blog-content p { flex-grow: 1; margin-bottom: 24px; font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    min-height: 56px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }

.btn-secondary {
    flex: 1;
    min-height: 48px;
    background: var(--bg-app);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* --- Content Sections --- */
.content-section { padding: 80px 0; }

.section-title { 
    font-size: 2.2rem; 
    font-weight: 950; 
    margin-top: 4rem;
    margin-bottom: 1.5rem; 
    text-align: center; 
    color: var(--primary); 
}

/* Standard Content Spacing */
.content-section p {
    margin-bottom: 1.6rem;
    line-height: 1.8;
}

.content-section h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 900;
    color: var(--primary);
}

/* --- Mobile Responsiveness (Strict) --- */
@media (max-width: 768px) {
    body { font-size: 14px; overflow-x: hidden; }
    
    .container { padding: 0 16px; }

    /* Header Structure (Pro Fix) */
    .header-main { padding: 12px 0; }
    
    .header-flex {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative;
    }

    .logo { 
        order: 1; 
        font-size: 1.1rem; 
    }
    .logo img { height: 28px !important; }

    /* Hide desktop nav containers */
    .nav-links,
    .nav-actions .nav-cta,
    .nav-actions .theme-toggle {
        display: none !important;
    }

    .nav-actions {
        order: 2;
    }

    /* Show ONLY hamburger */
    .hamburger {
        display: block !important;
        order: 2;
        margin: 0;
        line-height: 1;
        z-index: 1001;
    }

    /* Unified Mobile Menu (Links + CTA) */
    .nav-links.active {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border);
        z-index: 999;
        gap: 0;
        animation: slideDown 0.3s ease-out forwards;
    }

    .nav-link {
        font-size: 1.1rem;
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid var(--border);
        color: var(--text-main);
        text-align: center;
    }

    /* Hero Section (Compact SaaS Style) */
    .hero { padding: 32px 16px 48px; }
    .hero h1 { font-size: 26px !important; line-height: 1.1; margin-bottom: 12px; }
    .hero p { font-size: 16px; margin-bottom: 24px; }
    .hero .btn-cta { width: 100%; padding: 14px; font-size: 1.1rem; height: 48px; display: flex; align-items: center; justify-content: center; }

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

/* Desktop Breakpoint: Force Menu Visibility */
@media (min-width: 769px) {
    .nav-links {
        display: flex !important;
    }
    .nav-actions {
        display: flex !important;
    }
    .hamburger {
        display: none !important;
    }
}

    /* Hero Section (Compact SaaS Style) */
    .hero { padding: 32px 16px 48px; }
    .hero-content { max-width: 100%; }
    .hero-title { font-size: 26px; line-height: 1.1; margin-bottom: 12px; }
    .hero-subtitle { font-size: 15px; line-height: 1.4; margin-bottom: 24px; opacity: 0.8; }
    .btn-primary { width: 100%; min-height: 48px; margin-top: 12px; font-size: 0.9rem; }
    .trust-bar { margin-top: 16px; gap: 12px; font-size: 12px; }

    /* Calculator Section */
    .calculator-section { margin-top: -24px; }
    .calculator-card { padding: 24px 20px; border-radius: 12px; }
    .input-group { margin-bottom: 12px; }
    .input-field { font-size: 16px; padding: 12px; min-height: 44px; border-width: 1px; }
    
    #tool-card div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .result-box { padding: 24px 16px; margin-top: 20px; border-radius: 10px; }
    .res-grid { grid-template-columns: 1fr; gap: 16px; }
    .res-value { font-size: 2.2rem; line-height: 1; }
    .res-label { font-size: 0.6rem; letter-spacing: 0.05em; }
    
    .result-actions { margin-top: 16px; gap: 8px; }
    .result-actions button { min-height: 44px; font-size: 0.85rem; }

    /* Content & Spacing Consistency */
    .content-section { padding: 32px 0; }
    .section-title { font-size: 22px; margin-top: 1.5rem; margin-bottom: 1.25rem; }
    
    .content-section p { margin-bottom: 1.25rem; font-size: 15px; line-height: 1.5; }

    /* Formula Box (Compact) */
    .formula-box { font-size: 15px; padding: 16px; border-radius: 10px; margin: 16px 0; border-width: 1px; }

    /* Sponsored Section (Clean Slot) */
    .sponsored-slot { margin: 24px auto !important; }
    .sponsored-slot > div { height: 80px !important; font-size: 0.75rem !important; padding: 16px !important; }

    /* Cards & FAQ */
    .blog-grid { grid-template-columns: 1fr; gap: 12px; }
    .blog-card { border-radius: 12px; margin-bottom: 0; }
    .blog-content { padding: 20px; }
    .blog-content h4 { font-size: 1.05rem; }
    .blog-content p { font-size: 14px; margin-bottom: 16px; }

    /* Footer */
    footer { padding: 32px 0 20px; }
    footer p { font-size: 12px; margin-bottom: 24px !important; }
    footer div[style*="display: flex"] { gap: 16px !important; }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.animate-pop { animation: pop 0.3s ease-out; }
