/* ========================================
   SHARED HEADER & FOOTER - MapleLoop AI Partners
   Loaded by components.js on all pages
   ======================================== */

/* BASE - reset + brand body font, guaranteed on every page that loads the
   shared chrome. Mount-pattern pages also ship this in their page stylesheet
   (identical rules, so this is a no-op for them); native-port pages that load
   only shared.css + tokens depend on it. Without it, components authored for
   border-box + zeroed margins render with browser defaults: padding overflows
   card widths and body copy falls back to the default serif. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* HEADER */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    background: rgba(var(--bg-rgb), 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    z-index: 99999;
    display: flex;
    align-items: center;
    padding: 0 5%;
    transition: height 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.site-header.scrolled {
    height: 60px;
    box-shadow: none;
    background: rgba(var(--bg-rgb), 0.98);
    border-bottom-color: transparent;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}
.brand-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    color: var(--ink);
    letter-spacing: -0.5px;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-mark {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}
.brand-name { display: inline-flex; align-items: baseline; }
.brand-logo:hover { transform: scale(1.02); }
.brand-logo .dot {
    color: var(--accent);
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-logo:hover .dot { transform: scale(1.3); }
.brand-tagline {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    color: var(--stone-500);
    letter-spacing: 0.5px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--stone-300);
    text-transform: uppercase;
}
@media (max-width: 520px) {
    .brand-tagline { display: none; }
}
.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}
.nav-item {
    color: var(--stone-500);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: none;
}
.nav-item:hover { color: var(--ink); }
.nav-item.active { color: var(--ink); font-weight: 700; }
.nav-rescue { color: var(--accent-amber); font-weight: 600; }
.nav-rescue:hover { color: var(--accent-deep); }
.btn-header {
    padding: 10px 24px;
    background: var(--ink);
    color: white;
    border-radius: 0;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    text-decoration: none;
}
.btn-header:hover { background: var(--accent); }

/* Mobile hamburger */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}
.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ink);
    border-radius: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}
.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .site-header { padding: 0 20px; }
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: rgba(var(--bg-rgb), 0.98);
        padding: 20px;
        gap: 20px;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }
    .mobile-toggle { display: flex; }
}

/* FOOTER */
.footer-wrapper {
    background: var(--warm-1);
    color: var(--ink);
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--stone-300);
}
.footer-wrapper::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
    pointer-events: none;
}
.footer-cta {
    text-align: center;
    padding: 100px 20px;
    border-bottom: 1px solid var(--stone-300);
    position: relative;
    z-index: 1;
}
.footer-cta-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 16px;
    letter-spacing: -1px;
    text-wrap: balance;
}
.footer-cta-sub {
    color: var(--stone-600);
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-wrap: pretty;
}
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    color: var(--bg);
    padding: 20px 44px;
    border-radius: 0;
    font-weight: 700;
    font-size: 17px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: none;
    text-decoration: none;
}
.btn-primary::after {
    content: '\2192';
    transition: transform 0.25s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    transform: translateY(-3px);
    box-shadow: none;
}
.btn-primary:hover::after { transform: translateX(4px); }

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding: 60px 5%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.footer-cols ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.footer-heading {
    color: var(--stone-500);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    font-weight: 700;
}
.footer-link { color: var(--stone-600); transition: color 0.2s; font-size: 15px; text-decoration: none; }
.footer-link:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--stone-300);
    padding: 24px;
    text-align: center;
    color: var(--stone-500);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .footer-cta { padding: 60px 20px; }
    .footer-cols { padding: 40px 20px; gap: 32px; }
}
