:root {
    --primary-background: #F8FAFC;
    --primary-text: #0F172A;
    --secondary-background: #FFFFFF;
    --secondary-text: #475569;
    --card-background: #FFFFFF;
    --card-border: #E2E8F0;
    --accent-emerald: #0D9488;
    --accent-emerald-light: #F0FDFA;
    --accent-indigo: #4F46E5;
    --muted-border: #CBD5E1;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--primary-background);
    color: var(--primary-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

a:hover,
a:focus {
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-emerald);
    outline-offset: 2px;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease, box-shadow 0.3s ease-in-out;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
        word-break: break-word;
    }

    h2 {
        font-size: clamp(1.5rem, 4vw, 1.875rem);
        word-break: break-word;
    }

    h3 {
        font-size: clamp(1.25rem, 3.5vw, 1.5rem);
        word-break: break-word;
    }

    h4,
    h5,
    h6 {
        word-break: break-word;
    }

    a,
    p,
    span {
        overflow-wrap: break-word;
    }
}

/* ===== header_section ===== */
#site-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #ffffff;
    border-color: #e2e8f0
}

#mobile-menu.open {
    display: block
}

/* ===== hero_section ===== */
#hero-section {
    overflow: hidden;
    width: 100%;
}

#hero-section h1,
#hero-section p {
    hyphens: auto;
}

/* ===== budget_structure_section ===== */
#budget-structure {
    overflow: hidden;
}

/* ===== financial_scenarios_section ===== */
#financial-scenarios {
    overflow: hidden;
    width: 100%;
    hyphens: auto;
}

#financial-scenarios article {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#financial-scenarios article:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

/* ===== budgeting_methods_section ===== */
#budgeting-methods table {
    width: 100%;
    border-collapse: collapse;
}

#budgeting-methods td,
#budgeting-methods th {
    vertical-align: middle;
}

/* ===== in_depth_article_section ===== */
#in-depth-article {
    overflow: hidden;
}

#in-depth-article .prose p {
    hyphens: auto;
    line-height: 1.65;
}

/* ===== hidden_expenses_section ===== */
#hidden-expenses {
    overflow: hidden;
}

#hidden-expenses .js-expense-card {
    min-height: 100%;
}

#hidden-expenses .js-expense-card:focus-within {
    border-color: var(--accent-emerald);
}

/* ===== monthly_habits_section ===== */
#monthly-habits {
    overflow: hidden;
}

#monthly-habits h2,
#monthly-habits h3 {
    hyphens: auto;
    line-height: 1.25;
}

/* ===== footer_section ===== */
#site-footer {
    overflow: hidden;
    width: 100%;
}

#site-footer a {
    text-decoration: none;
}