:root {
    --primary-green: #043A1B;
    --primary-green-light: #065F2E;
    --primary-yellow: #F7D33B;
    --dark-gray: #333;
    --light-gray: #f8f9fa;
}

body {
    /* Use a system font stack for body to avoid layout shifts when the webfont loads */
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark-gray);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Use system font stack for headings to avoid layout shifts when webfonts load */
h1, h2, h3, h4 {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Explicit heading sizes to avoid browsers warning about headings without a specified font-size
    and to reduce layout shifts (provide predictable sizing during initial render) */
h1 { font-size: 2.25rem; line-height: 1.1; }
h2 { font-size: 1.75rem; line-height: 1.15; }
h3 { font-size: 1.5rem; line-height: 1.2; }
h4 { font-size: 1.25rem; line-height: 1.3; }
h5 { font-size: 1rem; line-height: 1.4; }
h6 { font-size: 0.875rem; line-height: 1.4; }

.text-shadow {
    /* Reduced shadow to lower expensive paint work while keeping readable contrast */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Visual hero styles to match the prominent yellow headline on dark green background */
.hero-h1 {
    /* Use system fonts to avoid layout shifts caused by webfont swapping */
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-transform: uppercase;
    color: var(--primary-yellow) !important;
    letter-spacing: 1.5px;
    /* Reduced shadow and slightly larger line-height to avoid reflow when rendering */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.45);
    margin: 0 0 0.125rem 0;
    font-weight: 900;
    line-height: 1.05;
    font-size: 3.25rem; /* mobile baseline */
}

/* Deferred decorative shadow: keep initial paint cheap, enable decoration after load */
.hero-h1.no-shadow {
    text-shadow: none !important;
}

.hero-h2 {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 800;
    color: var(--primary-yellow) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

/* Reduce space for hero paragraph under the headline */
#home .container p {
    margin-top: 0.35rem !important;
    margin-bottom: 0.5rem !important;
}

@media (min-width: 640px) {
    .hero-h1 { font-size: 4rem; }
    .hero-h2 { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
    /* Slightly reduced desktop headline to avoid large repaint cost */
    .hero-h1 { font-size: 4.5rem; }
    .hero-h2 { font-size: 2.75rem; }
}

/* Hero Section Styling */
#home {
    background-color: var(--primary-green) !important;
    background: var(--primary-green) !important;
    overflow-x: hidden;
    /* Make the hero occupy the viewport (subtract fixed nav height) so it's seen as a whole section */
    min-height: calc(100vh - 60px) !important;
    /* Add extra space at the top so the headline sits lower in the hero */
    padding-top: 3.5rem !important;
    padding-bottom: 1.5rem !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

/* Adjust hero container spacing: avoid forcing large reserved height */
#home .container {
    min-height: auto !important;
    /* keep container content snug but allow the #home padding to provide top spacing */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

@media (min-width: 1024px) {
    /* Slightly more top space on desktop so the hero reads as a single-page section */
    #home { padding-top: 5rem !important; }
}

/* Ensure all sections don't cause horizontal overflow */
section {
    overflow-x: hidden;
}

/* Accessibility: ensure footer link/text variants have sufficient contrast on dark background */
.bg-gray-800 .text-gray-400,
footer .text-gray-400 {
    color: #e5e7eb; /* Tailwind gray-200 equivalent for better contrast */
}

/* Global helper for high-contrast footer text when needed */
.footer-text-contrast { color: #e5e7eb !important; }

/* Strong footer contrast overrides to satisfy accessibility audits
   - Ensure footer background is a solid, dark color (no transparency)
   - Force link/text to pure white for sufficient contrast on small text
*/
footer, .bg-gray-800 {
    background-color: #0b1220 !important; /* darker than tailwind gray-800 to maximize contrast */
}

footer, footer p, footer li, footer a, footer span, footer div {
    color: #ffffff !important; /* pure white for maximum contrast */
}

/* Keep link hover/focus visible but still high contrast */
footer a:hover, footer a:focus {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Small footer text can be slightly lighter but still accessible */
footer .text-sm, footer small {
    color: #e6eef8 !important;
}

/* Use content-visibility to skip rendering work for off-screen sections (modern browsers) */
section:not(#home):not(.critical) {
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* Responsive container fix */
.container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 640px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-yellow) 100%);
}

.btn-primary {
    /* Yellow button: keep yellow background but use a darker green for text to meet WCAG contrast */
    background-color: var(--primary-yellow);
    color: #042a10; /* darker green for accessible contrast */
    border: 2px solid var(--primary-yellow);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.btn-primary:hover {
    background-color: var(--primary-green);
    color: #ffffff;
}

.btn-secondary {
    /* Green button with white text for best contrast */
    background-color: var(--primary-green);
    color: #ffffff !important;
    border: 2px solid var(--primary-green);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.btn-secondary:hover {
    background-color: var(--primary-green-light);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.testimonial-card {
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.resource-card {
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.active {
    opacity: 1;
}

.scroll-to-top:hover {
    background-color: #218838;
}

.stats-box {
    transition: all 0.3s ease;
}

.stats-box:hover {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    background-color: var(--primary-green);
    color: white;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Coach Section and Beyond - Primary Theme Colors */
#coach {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-green) 100%) !important;
    color: white !important;
}

#coach h2 {
    color: var(--primary-green) !important;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8) !important;
}

#coach h3 {
    color: var(--primary-green) !important;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8) !important;
}

#coach p {
    color: white !important;
}

#coach .stats-box {
    background-color: var(--primary-yellow) !important;
    border-left-color: var(--primary-green) !important;
}

#coach .stats-box .text-3xl {
    color: var(--primary-green) !important;
}

#coach .stats-box .text-gray-700 {
    color: var(--primary-green) !important;
}

#resources {
    background-color: var(--primary-yellow) !important;
}

#resources h2 {
    color: var(--primary-green) !important;
}

#resources p {
    color: var(--primary-green) !important;
}

#resources .resource-card {
    background-color: white !important;
    border: 2px solid var(--primary-green) !important;
}

#resources .resource-card h3 {
    color: var(--primary-green) !important;
}

#resources .resource-card p {
    color: var(--primary-green) !important;
}

#success {
    background-color: var(--primary-green) !important;
}

#success h2 {
    color: var(--primary-yellow) !important;
}

#success > div > p {
    color: white !important;
}

#success .testimonial-card {
    background-color: var(--primary-yellow) !important;
    border-top-color: var(--primary-green) !important;
}

#success .testimonial-card h4 {
    color: var(--primary-green) !important;
}

#success .testimonial-card p {
    color: var(--primary-green) !important;
}

#success .testimonial-card .text-gray-500 {
    color: var(--primary-green) !important;
}

#contact {
    /* Pricing/contact section uses site branding gradient */
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-yellow) 100%) !important;
}

/* Footer background is controlled earlier to ensure strong contrast. Remove duplicate/contradicting rule. */

footer h4 {
    color: var(--primary-yellow) !important;
}

footer .text-gray-400 {
    color: white !important;
}

footer .text-gray-400:hover {
    color: var(--primary-yellow) !important;
}

footer .bg-gray-700 {
    background-color: var(--primary-yellow) !important;
}

footer .bg-gray-700:hover {
    background-color: white !important;
    color: var(--primary-green) !important;
}

footer .bg-green-600 {
    background-color: var(--primary-yellow) !important;
    color: var(--primary-green) !important;
}

footer .bg-green-600:hover {
    background-color: white !important;
}

/* Accessibility: force better contrast for Tailwind-like utility classes used in HTML */
/* Make semi-transparent white classes fully opaque so they pass contrast on dark backgrounds */
.text-white\/60, .text-white\/70, .text-white\/80, .text-white\/90 {
    color: #ffffff !important;
}

/* Ensure bg-green-600 maps to the site's primary green and pairs with white text */
.bg-green-600 {
    background-color: var(--primary-green) !important;
}
.bg-green-600.text-white,
a.bg-green-600.text-white,
.btn-primary.bg-green-600 {
    background-color: var(--primary-green) !important;
    color: #ffffff !important;
}

/* Also ensure links/buttons with bg-green-600 are visible on hover */
.bg-green-600:hover, a.bg-green-600:hover {
    background-color: var(--primary-green-light) !important;
    color: #ffffff !important;
}


/* Accessibility: ensure purple text on light purple backgrounds has sufficient contrast */
/* Tailwind-like utilities used in markup: bg-purple-50 and text-purple-600 */
.bg-purple-50 {
    background-color: #f5f3ff !important; /* Tailwind purple-50 */
}

/* Use a darker purple for text to reach WCAG contrast */
.text-purple-600 {
    color: #4b0082 !important; /* darker, high-contrast purple */
}

.stats-box.bg-purple-50 {
    border-left-color: #4b0082 !important;
}

.stats-box.bg-purple-50 .text-lg,
.stats-box.bg-purple-50 .text-purple-600 {
    color: #4b0082 !important;
}

