/* 0) Brand & Styling Requirements */
:root {
    --mbh-bg: #ffffff;
    --mbh-fg: #0f172a;        /* slate-900 */
    --mbh-muted: #475569;     /* slate-600 */
    --mbh-primary: #00529b;   /* Derived from logo - strong blue */
    --mbh-accent: #0891b2;    /* Complimentary cyan */
    --mbh-action: #E87A5D;    /* Terracotta for CTAs */
    --mbh-bg-alt: #F5F5F5;    /* Warm Light Gray */
    --mbh-border: #e2e8f0;    /* slate-200 */
    --mbh-card: #ffffff;
    --header-height: 72px;
}

/* 1) Base & Accessibility */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--mbh-bg);
    color: var(--mbh-fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--mbh-primary);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* 2) Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mbh-fg);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
    margin-bottom: 1rem;
    color: var(--mbh-muted);
    max-width: 65ch;
}

a {
    color: var(--mbh-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
a:hover, a:focus-visible {
    text-decoration: underline;
    color: var(--mbh-accent);
}

/* 3) Layout & Components */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

section {
    padding-top: clamp(4rem, 10vw, 6rem);
    padding-bottom: clamp(4rem, 10vw, 6rem);
}

.section-hero {
    text-align: center;
    padding-top: calc(var(--header-height) + 4rem);
}

.section-hero .subheadline {
    font-size: 1.25rem;
    color: var(--mbh-muted);
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn:hover, .btn:focus-visible {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}
.btn-primary {
    background-color: var(--mbh-primary);
    color: var(--mbh-bg);
}
.btn-action {
    background-color: var(--mbh-action);
    color: var(--mbh-bg);
}
.btn-secondary {
    background-color: transparent;
    color: var(--mbh-primary);
    border-color: var(--mbh-border);
}

.cta-trio {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.card {
    background-color: var(--mbh-card);
    border: 1px solid var(--mbh-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
}

/* 4) Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.site-header.scrolled {
    border-bottom-color: var(--mbh-border);
}

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

.logo-link .logo-img {
    height: 60px; /* Adjust logo height */
    width: auto;
    display: block;
}

.nav-links {
    display: none; /* Hidden on mobile */
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 600;
    color: var(--mbh-muted);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--mbh-primary);
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a:focus-visible::after {
    width: 100%;
}

.menu-toggle {
    display: block; /* Visible on mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.menu-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--mbh-fg);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--mbh-bg);
    border-bottom: 1px solid var(--mbh-border);
    padding: 1rem 0;
}

.mobile-menu.is-open {
    display: block;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
}

.mobile-nav-links li {
    padding: 1rem 0;
}

.mobile-nav-links a {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--mbh-fg);
}

/* Menu toggle animation */
body.menu-open .menu-toggle .icon-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
body.menu-open .menu-toggle .icon-bar:nth-child(2) {
    opacity: 0;
}
body.menu-open .menu-toggle .icon-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (min-width: 768px) {
    .menu-toggle, .mobile-menu {
        display: none;
    }
    .nav-links {
        display: flex;
    }
}

/* 5) Section-Specific Styles */

/* Background Utilities */
.bg-alt {
    background-color: var(--mbh-bg-alt);
}
.bg-gradient-to-alt {
    background: linear-gradient(to bottom, var(--mbh-bg) 0%, var(--mbh-bg-alt) 100%);
}
.bg-gradient-to-main {
    background: linear-gradient(to bottom, var(--mbh-bg-alt) 0%, var(--mbh-bg) 100%);
}

/* Logo Wall */
.logo-wall {
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}
.logo-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}
.logo-wall:hover .logo-track {
    animation-play-state: paused;
}
.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    width: 180px;
    margin: 0 2rem;
}
.logo-item svg {
    width: 120px;
    height: auto;
    fill: #cbd5e1; /* slate-300 */
}
.logo-item img {
    width: 120px;
    height: auto;
    object-fit: contain;
    filter: grayscale(1) opacity(0.7);
    transition: filter 0.3s ease;
}
.logo-wall:hover .logo-item img {
    filter: grayscale(0) opacity(1);
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* How We Help */
.how-we-help-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}
@media (min-width: 768px) {
    .how-we-help-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Testimonials */
.testimonial-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}
.testimonial-card blockquote {
    font-size: 1.1rem;
    font-style: italic;
    border-left: 3px solid var(--mbh-primary);
    padding-left: 1.5rem;
    margin: 0 0 1rem 0;
}
.testimonial-card footer {
    font-weight: 600;
}
@media (min-width: 768px) {
    .testimonial-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* CTA Band */
.cta-band {
    background-color: var(--mbh-fg);
    color: var(--mbh-bg);
    text-align: center;
    border-radius: 1rem;
    padding: clamp(3rem, 8vw, 4rem);
}
.cta-band h2 {
    color: var(--mbh-bg);
}
.cta-band .btn {
    margin-top: 1.5rem;
}

/* 6) Footer */
.site-footer {
    background-color: var(--mbh-bg-alt);
    border-top: 1px solid var(--mbh-border);
    padding: 3rem 0;
    color: var(--mbh-muted);
}
.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}
.footer-logo img {
    height: 48px;
    width: auto;
}
.footer-text p {
    margin: 0;
}
.footer-text .copyright {
    margin-top: 1rem;
    font-size: 0.9rem;
}
@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .footer-text {
        text-align: right;
    }
}


/* 7) Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(.2,.65,.3,1), transform 0.4s cubic-bezier(.2,.65,.3,1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .animate-on-scroll {
        transition: none;
        opacity: 1;
        transform: none;
    }
    .logo-track {
        animation: none;
    }
    .btn:hover, .btn:focus-visible {
        transform: none;
    }
}

/* Helper class */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
