/* ==========================================================
   Crumb Bouncer — Shared Design System
   Extracted from index.html premium design.
   Every page links this file for consistent nav, footer,
   typography, scroll-reveal, and animations.
   Page-specific styles remain inline in each page.
   ========================================================== */

/* ---- Design Tokens ---- */
:root {
    --navy: #2c3e50;
    --navy-light: #34495e;
    --celiac-green: #4CAF50;
    --celiac-green-bright: #5BC85F;
    --green-dark: #388E3C;
    --white: #ffffff;
    --off-white: #f8f9fa;
    --light-gray: #e9ecef;
    --text-dark: #212529;
    --text-medium: #495057;
}

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

/* ---- Body Base ---- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    animation: pageFadeIn 0.8s ease-out;
    overflow-x: hidden;
}

/* ---- Skip Navigation ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--navy);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    z-index: 200;
    transition: top 0.2s;
}

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

/* ---- Keyframes ---- */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Form Element Focus ---- */
input,
textarea,
select {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 16px;
    background: var(--white);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--celiac-green);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.12);
}

/* ---- Heading Base ---- */
h1, h2, h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    line-height: 1.1;
}

/* ---- Navigation ---- */
nav {
    padding: 20px 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-container img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--celiac-green);
}

.nav-cta {
    background: var(--navy);
    color: var(--white) !important;
    padding: 12px 28px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: 0.02em;
}

.nav-cta:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.25);
    color: var(--white) !important;
}

/* Hamburger Menu Button (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10000;
    position: relative;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.nav-links.open {
    display: flex;
}

/* ---- Footer ---- */
footer {
    padding: 80px 6% 48px;
    background: var(--text-dark);
    color: var(--white);
}

.footer-mission {
    max-width: 800px;
    margin: 0 auto 48px;
    padding: 32px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-mission h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.footer-mission p {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 12px;
    text-align: center;
}

.footer-mission p:last-child {
    margin-bottom: 0;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand img {
    height: 20px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
}

.footer-column h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 14px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.footer-column a:hover {
    color: var(--white);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-weight: 300;
}

/* ---- Scroll Reveal ---- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---- Shared Page Content Styles ---- */

/* Full-bleed hero images used on about, how-it-works, etc. */
.hero-full-bleed {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 400px;
    object-fit: cover;
    display: block;
}

/* Page content container */
.page-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 80px 6%;
}

.page-content h1 {
    font-size: 48px;
    color: var(--navy);
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.page-content h2 {
    font-size: 32px;
    color: var(--navy);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.page-content h3 {
    font-size: 22px;
    color: var(--navy);
    margin-bottom: 16px;
    font-weight: 700;
}

.page-content p {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-medium);
    margin-bottom: 20px;
    font-weight: 300;
}

.page-content strong {
    font-weight: 600;
    color: var(--text-dark);
}

/* Shared section spacer */
.section-spacer {
    height: 1px;
    background: var(--light-gray);
    margin: 60px 0;
}

/* Photo breaks between content sections */
.photo-break {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 300px;
    object-fit: cover;
    display: block;
    margin-top: 60px;
    margin-bottom: 60px;
}

/* CTA Section (bottom of content pages) */
.cta-section {
    text-align: center;
    padding: 80px 6%;
    background: var(--off-white);
}

.cta-section h2 {
    font-size: 36px;
    color: var(--navy);
    margin-bottom: 16px;
    letter-spacing: -1.5px;
}

.cta-section p {
    font-size: 18px;
    color: var(--text-medium);
    margin-bottom: 32px;
    font-weight: 300;
}

/* Utility: Pill Buttons */
.btn-green-pill {
    display: inline-block;
    background: var(--celiac-green);
    color: var(--white);
    padding: 16px 40px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: 0.02em;
}

.btn-green-pill:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
}

.btn-green-pill:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.25);
}

.btn-navy-pill {
    display: inline-block;
    background: var(--navy);
    color: var(--white);
    padding: 16px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: 0.02em;
}

.btn-navy-pill:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.25);
}

.btn-navy-pill:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2);
}

/* ---- Shared Scroll-Reveal Script ---- */
/* Add this script before </body> on every page:

<script>
document.addEventListener('DOMContentLoaded', function() {
    const revealElements = document.querySelectorAll('.reveal');
    if ('IntersectionObserver' in window) {
        const observer = new IntersectionObserver(function(entries) {
            entries.forEach(function(entry) {
                if (entry.isIntersecting) {
                    entry.target.classList.add('visible');
                    observer.unobserve(entry.target);
                }
            });
        }, { threshold: 0.15, rootMargin: '0px 0px -40px 0px' });
        revealElements.forEach(function(el) { observer.observe(el); });
    } else {
        revealElements.forEach(function(el) { el.classList.add('visible'); });
    }
});
</script>

*/

/* ==========================================================
   Responsive — Shared Elements
   ========================================================== */

/* ---- Tablet (max-width: 968px) ---- */
@media (max-width: 968px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        z-index: 9999;
        overflow-y: auto;
        padding: 80px 20px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        font-size: 20px;
        font-weight: 600;
    }

    .nav-cta {
        padding: 16px 36px;
        font-size: 17px;
    }

    .page-content h1 {
        font-size: 38px;
    }

    .page-content h2 {
        font-size: 28px;
    }

    .hero-full-bleed {
        height: 300px;
    }

    .photo-break {
        height: 220px;
    }

    .cta-section h2 {
        font-size: 30px;
    }
}

/* ---- Mobile (max-width: 640px) ---- */
@media (max-width: 640px) {
    nav {
        padding: 16px 5%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 36px;
    }

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

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

    .footer-bottom {
        font-size: 12px;
    }

    .page-content {
        padding: 48px 5%;
    }

    .page-content h1 {
        font-size: 32px;
        letter-spacing: -1.5px;
    }

    .page-content h2 {
        font-size: 24px;
    }

    .page-content p {
        font-size: 16px;
    }

    .hero-full-bleed {
        height: 220px;
    }

    .photo-break {
        height: 180px;
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .cta-section {
        padding: 60px 5%;
    }

    .cta-section h2 {
        font-size: 26px;
    }
}
