:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-alt: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-green: #059669;
    --accent-gold: #d97706;
    --accent-blue: #0284c7;
    --border-color: #e2e8f0;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Theme overrides for different pages */
body.theme-problem {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-alt: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-green: #e11d48; /* Crimson */
    --border-color: #334155;
}

body.theme-solution {
    --bg-primary: #e0f2fe;
    --bg-secondary: #f0f9ff;
    --bg-alt: #bae6fd;
    --text-primary: #082f49;
    --text-secondary: #0c4a6e;
    --accent-green: #0284c7; 
    --border-color: #7dd3fc;
}

body.theme-research {
    --bg-primary: #f5f3ff;
    --bg-secondary: #faf5ff;
    --bg-alt: #ede9fe;
    --text-primary: #2e1065;
    --text-secondary: #4c1d95;
    --accent-green: #7c3aed; 
    --border-color: #ddd6fe;
}

body.theme-impact {
    --bg-primary: #f0fdf4;
    --bg-secondary: #fdfaf0;
    --bg-alt: #dcfce7;
    --text-primary: #14532d;
    --text-secondary: #166534;
    --accent-green: #d97706; /* Earthy Gold */
    --border-color: #bbf7d0;
}

body.theme-financials {
    --bg-primary: #172554;
    --bg-secondary: #1e3a8a;
    --bg-alt: #0b1120;
    --text-primary: #f8fafc;
    --text-secondary: #bfdbfe;
    --accent-green: #fbbf24; /* Financial Gold */
    --border-color: #1e40af;
}

body.theme-strategy {
    --bg-primary: #ffffff;
    --bg-secondary: #fff7ed;
    --bg-alt: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --accent-green: #ea580c; /* Orange */
    --border-color: #ffedd5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 4rem; margin-bottom: 1rem; }
h2 { font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--accent-green); margin-top: 3rem; }
h3 { font-size: 1.75rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--text-primary); }
h4 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

.prose p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose strong {
    color: var(--text-primary);
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
    text-align: left;
}

.prose th, .prose td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.prose th {
    background-color: var(--bg-alt);
    color: var(--text-primary);
    font-weight: 600;
}

.prose tr:hover {
    background-color: var(--bg-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 1140px;
    z-index: 1000;
    padding: 0.6rem 2.5rem;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: visible;
}

/* On subpages, navbar needs solid bg from start */
body:not(.light-theme) .navbar {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar.scrolled {
    top: 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 0.4rem 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

/* Ensure navbar text is visible on colored backgrounds */
body:not(.light-theme) .nav-links a {
    color: #0f172a;
}

.navbar.scrolled .nav-links a {
    color: #0f172a;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.logo img {
    height: 110px;
    width: auto;
    transition: all 0.4s ease;
    margin: -32px 0;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

.navbar.scrolled .logo img {
    height: 85px;
    margin: -24px 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.4rem;
    align-items: center;
}

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links li:not(:last-child)::after {
    content: '•';
    color: rgba(255, 255, 255, 0.45);
    margin-left: 0.4rem;
    font-size: 0.7rem;
}

.navbar.scrolled .nav-links li:not(:last-child)::after {
    color: #475569;
}

body:not(.light-theme) .nav-links li:not(:last-child)::after {
    color: #475569;
}

.nav-links a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    font-size: 0.85rem;
    white-space: nowrap;
}

.navbar.scrolled .nav-links a:hover,
body:not(.light-theme) .nav-links a:hover {
    color: var(--accent-green);
}

/* Hero Section (Home only) */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -5%;
    width: 110%;
    height: 150px;
    background: var(--bg-primary);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    z-index: 5;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 40%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
}

.hero-content h1 {
    color: #ffffff;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Subpage Hero */
.subpage-hero {
    position: relative;
    padding: 12rem 2rem 6rem;
    text-align: center;
    overflow: hidden;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subpage-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.subpage-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 2;
}

.subpage-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -5%;
    width: 110%;
    height: 100px;
    background: var(--bg-primary);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    z-index: 5;
}

.subpage-hero .container {
    position: relative;
    z-index: 3;
}

.subpage-hero h1 {
    color: #ffffff;
    font-size: 3.5rem;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.subpage-hero .hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.subpage-hero .badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* Sections */
.text-section {
    padding: 4rem 2rem;
    position: relative;
    background-color: var(--bg-primary);
}

.text-section.dark-alt {
    background-color: var(--bg-secondary);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Premium GSAP Horizontal Gallery */
.gallery-pin-section {
    overflow: hidden;
    background-color: var(--bg-secondary);
    padding: 4rem 0;
}

.gallery-container {
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
}

.gallery-track {
    display: flex;
    gap: 2rem;
    padding: 0 5vw;
}

.gallery-item {
    flex: 0 0 60vw;
    height: 60vh;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@media (min-width: 1024px) {
    .gallery-item {
        flex: 0 0 40vw;
    }
}

/* Footer */
.light-footer {
    padding: 4rem 2rem 2rem;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 160px;
    width: auto;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.navbar.scrolled .hamburger span,
body:not(.light-theme) .hamburger span {
    background: #0f172a;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .navbar {
        top: 0.75rem;
        padding: 0.5rem 1.2rem;
        border-radius: 20px;
        width: calc(100% - 2rem);
        max-width: none;
    }

    .navbar.scrolled {
        top: 0.5rem;
        padding: 0.4rem 1.2rem;
    }

    .nav-content {
        gap: 0;
    }

    .logo img {
        height: 80px;
        margin: -22px 0;
    }

    .navbar.scrolled .logo img {
        height: 65px;
        margin: -16px 0;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.75rem);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-radius: 16px;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li:not(:last-child)::after {
        display: none;
    }

    .nav-links a {
        color: #0f172a !important; /* Force dark text on white dropdown background */
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 10px;
        font-size: 0.95rem;
        transition: background 0.2s;
    }

    .nav-links a:hover {
        background: #f1f5f9; /* Force light gray hover on white dropdown background */
        color: var(--accent-green) !important;
    }

    /* Hero responsive */
    h1 {
        font-size: 2.25rem;
    }

    .hero {
        height: 85vh;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .subpage-hero {
        padding: 9rem 1.5rem 4rem;
        min-height: 40vh;
    }

    .subpage-hero h1 {
        font-size: 2.25rem;
    }

    /* Gallery responsive */
    .gallery-item {
        flex: 0 0 80vw;
        height: 45vh;
    }

    /* Sections responsive */
    .text-section {
        padding: 3rem 1.25rem;
    }

    .prose table {
        font-size: 0.85rem;
    }

    .prose th, .prose td {
        padding: 0.6rem;
    }

    .footer-logo img {
        height: 100px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .logo img {
        height: 65px;
        margin: -16px 0;
    }

    .navbar.scrolled .logo img {
        height: 55px;
        margin: -12px 0;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .prose p, .prose ul, .prose ol {
        font-size: 1rem;
    }
}

/* Enhancements */
.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    margin-top: 1.5rem;
    background: var(--accent-green);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: #fff;
}

.scroll-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body:not(.light-theme) .scroll-top {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-top:hover {
    transform: translateY(-6px) scale(1.05);
    background: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.4);
}

.data-highlight {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-green);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.footer-enhanced {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}
.footer-enhanced a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
.footer-enhanced a:hover {
    color: var(--accent-green);
}
