/* ==========================================================
   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 ---- */
/* Warm paper-and-ink system (replaces cool slate/Bootstrap grays).
   The bouncer's navy lives in the LOGO; the UI runs on warm ink + cream.
   Celiac green #52B96A is the anchor: brand, CTA, safety signal. */
:root {
    --navy: #2B2420;            /* was slate #2c3e50 — now warm ink */
    --navy-light: #5A4F47;      /* warm ink-soft (hovers) */
    --celiac-green: #52B96A;
    --celiac-green-bright: #52B96A;
    --green-dark: #45a85c;      /* hover/active green */
    --celiac-green-text: #2F7B49; /* deeper green for small text on cream */
    --white: #ffffff;
    --off-white: #F4EDE2;       /* warm paper (was #F9F7F4) */
    --light-gray: #EBE3D6;      /* warm light (borders/spacers) */
    --text-dark: #2B2420;       /* warm ink (was #212529) */
    --text-medium: #5A4F47;     /* warm ink-soft (was #495057) */
    --dark-section: #211B17;    /* warm dark (footer) */
}

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

/* ---- Body Base ---- */
body {
    font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--off-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 12px 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    z-index: 200;
    transition: top 0.2s;
}

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

/* Focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
.cta-button:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--celiac-green);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---- 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: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    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(82, 185, 106, 0.12);
}

/* ---- Heading Base ---- */
h1, h2, h3 {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-weight: 560;
    line-height: 1.08;
    letter-spacing: -0.02em;
    font-optical-sizing: auto;
}

/* ---- 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: 48px;
    width: auto;
    position: relative;
    top: -2px;
}

.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-text);
}

.nav-cta {
    background: var(--celiac-green);
    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(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(82, 185, 106, 0.3);
    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(--dark-section);
    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: 1200px;
    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.7);
    font-weight: 400;
}

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

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    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: 1200px;
    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.7);
    font-size: 13px;
    font-weight: 400;
}

/* ---- 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; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---- 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: -0.025em;
}

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

.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: 400;
}

.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: -0.025em;
}

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

/* 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(82, 185, 106, 0.3);
}

.btn-green-pill:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(82, 185, 106, 0.25);
}

.cta-microcopy {
    margin-top: 18px;
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.5;
}

.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 {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--white);
    }

    .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: -0.025em;
    }

    .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;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
