/* ==========================================================================
   GLOBAL STYLES & VARIABLES
   ========================================================================== */

:root {
    /* Colors - Teal/Emerald Primary */
    --color-primary: #0D9488;
    --color-primary-light: #14B8A6;
    --color-primary-dark: #0F766E;
    --color-accent: #F59E0B;
    /* Amber */

    /* Colors - Neutrals */
    --color-bg-body: #FFFFFF;
    --color-bg-surface: #F9FAFB;
    --color-text-main: #1F2937;
    /* Gray 800 */
    --color-text-secondary: #4B5563;
    /* Gray 600 */
    --color-text-muted: #9CA3AF;
    /* Gray 400 */
    --color-border: #E5E7EB;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-display: 'Outfit', var(--font-sans);

    /* Spacing */
    --container-width: 1200px;
    --header-height: 72px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Theme-specific variables (Default: Neutral/Personal) */
    --world-primary: var(--color-primary);
    --world-primary-dark: var(--color-primary-dark);
    --world-soft-bg: #F0FDFA;
    --world-badge-bg: #CCFBF1;
    --world-badge-text: #0D9488;
}

/* ==========================================================================
   WORLD THEME OVERRIDES
   ========================================================================== */

/* World 1: Personal Money (Teal) - Same as Default but explicit */
[data-world="1"] {
    --color-primary: #0D9488;
    --color-primary-light: #14B8A6;
    --color-primary-dark: #0F766E;
    --world-primary: #0D9488;
    --world-primary-dark: #0F766E;
    --world-soft-bg: #F0FDFA;
    --world-badge-bg: #CCFBF1;
    --world-badge-text: #0D9488;
}

/* World 2: Business Money (Amber) */
[data-world="2"] {
    --color-primary: #F59E0B;
    --color-primary-light: #FBBF24;
    --color-primary-dark: #D97706;
    --world-primary: #F59E0B;
    --world-primary-dark: #D97706;
    --world-soft-bg: #FFFBEB;
    --world-badge-bg: #FEF3C7;
    --world-badge-text: #92400E;
}

/* World 3: Macro Money (Purple) */
[data-world="3"] {
    --color-primary: #8B5CF6;
    --color-primary-light: #A78BFA;
    --color-primary-dark: #7C3AED;
    --world-primary: #8B5CF6;
    --world-primary-dark: #7C3AED;
    --world-soft-bg: #F5F3FF;
    --world-badge-bg: #EDE9FE;
    --world-badge-text: #5B21B6;
}

/* World 4: Dark Money (Red) */
[data-world="4"] {
    --color-primary: #EF4444;
    --color-primary-light: #F87171;
    --color-primary-dark: #DC2626;
    --world-primary: #EF4444;
    --world-primary-dark: #DC2626;
    --world-soft-bg: #FEF2F2;
    --world-badge-bg: #FEE2E2;
    --world-badge-text: #B91C1C;
}

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

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-main);
    margin-bottom: var(--space-3);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
}

ul {
    list-style: none;
}

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

/* Utilities */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container--wide {
    max-width: 1100px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center {
    text-align: center;
}

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

.mt-6 {
    margin-top: 1.5rem;
}

/* Accessibility Focus States */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Base Form Focus */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Layout Utilities */
.section {
    padding: 4rem 0;
    position: relative;
}

.section--sm {
    padding: 2rem 0;
}

/* Advertisement Specific Fix */
.section--sm[aria-label="Advertisement"] {
    padding: 1rem 0;
    /* Compact separator */
    background-color: var(--color-bg-body);
    /* Ensure cleanliness */
    text-align: center;
}

.section--surface {
    background-color: var(--color-bg-surface);
}

/* ==========================================================================
   FOOTER SEPARATOR (Global & World-Aware)
   ========================================================================== */
/* ==========================================================================
   FOOTER SEPARATOR (Global & World-Aware)
   ========================================================================== */
.footer-separator {
    height: 8px;
    background: linear-gradient(90deg,
            var(--color-primary),
            var(--color-primary-light));
    margin: 0;
}

/* ==========================================================================
   SECTION → SEPARATOR HANDOFF FIX (Canonical Layer-1 Rule)
   ========================================================================== */

/* 1. Kill any accidental white padding before footer */
main {
    margin-bottom: 0;
}

/* 2. Ensure last section in main has no bottom spacing */
main>section:last-of-type {
    margin-bottom: 0;
}

/* 3. Add spacing after footer separator for visual breathing room */
.footer-separator+.footer {
    padding-top: 2.5rem;
}

/* 4. Prevent tool-specific sections from leaking white space */
.tool-education,
.tool-cta {
    margin-bottom: 0 !important;
}

/* 5. Extra safety: Prevent any last div child from creating gaps */
main>div:last-of-type {
    margin-bottom: 0 !important;
}
/* ==========================================================================
   LAYER-1 COLORED SURFACE SYSTEM (DO NOT MODIFY PER PAGE)
   ========================================================================== */

/* Canonical colored surface - all colored sections MUST use this */
.colored-surface {
    position: relative;
    overflow: hidden;
    color: white;
}

/* Decorative bubble: top-right */
.colored-surface::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 420px;
    height: 420px;
    background: white;
    opacity: 0.06;
    border-radius: 50%;
    z-index: 1;
}

/* Decorative bubble: bottom-left */
.colored-surface::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -25%;
    width: 380px;
    height: 380px;
    background: white;
    opacity: 0.04;
    border-radius: 50%;
    z-index: 1;
}

/* Content always above decoration */
.colored-surface > .container,
.colored-surface > .inner,
.colored-surface > * {
    position: relative;
    z-index: 2;
}

/* Internal divider (optional but standardized) */
.colored-surface__divider {
    width: 100%;
    max-width: 720px;
    height: 1px;
    margin: 3rem auto 2.5rem;
    background: rgba(255, 255, 255, 0.35);
}

/* Responsive safety */
@media (max-width: 768px) {
    .colored-surface::after,
    .colored-surface::before {
        width: 260px;
        height: 260px;
    }

    .colored-surface__divider {
        margin: 2rem auto;
    }
}
