/**
 * BLADE BOSS — Footer Styles
 * 
 * Dark theme footer with CTA banner, 4-column grid, and premium polish.
 * Depends on: design-tokens.css, base.css
 */


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER CTA BANNER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bb-footer-cta {
    background: linear-gradient(135deg, var(--bb-green-dark) 0%, var(--bb-green) 100%);
    padding: var(--space-10) 0;
    position: relative;
    overflow: hidden;
}

.bb-footer-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(245, 120, 66, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.bb-footer-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    position: relative;
    z-index: 1;
}

.bb-footer-cta-text h3 {
    font-size: var(--text-3xl);
    color: var(--bb-white);
    margin-bottom: var(--space-2);
}

.bb-footer-cta-text p {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .bb-footer-cta {
        padding: var(--space-8) 0;
    }

    .bb-footer-cta-inner {
        flex-direction: column;
        text-align: center;
    }

    .bb-footer-cta-text h3 {
        font-size: var(--text-2xl);
    }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MAIN FOOTER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bb-footer {
    background: var(--bb-navy);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-10) 0 var(--space-6);
}

.bb-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}


/* ━━━ Brand column ━━━ */

.bb-footer-logo {
    display: inline-block;
    margin-bottom: var(--space-4);
    transition: opacity var(--duration-normal) var(--ease-out);
}

.bb-footer-logo:hover {
    opacity: 0.8;
}

.bb-footer-logo img {
    height: 32px;
    width: auto;
}

.bb-footer-tagline {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bb-green-muted);
    margin-bottom: var(--space-4);
}

.bb-footer-description {
    font-size: var(--text-sm);
    line-height: 1.7;
    max-width: 300px;
}


/* ━━━ Link columns ━━━ */

.bb-footer-heading {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--bb-white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-5);
}

.bb-footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.bb-footer-links a {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--duration-fast) var(--ease-out);
}

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


/* ━━━ Bottom bar ━━━ */

.bb-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-6);
}

.bb-footer-copyright {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.4);
}

.bb-footer-social {
    display: flex;
    gap: var(--space-4);
}

.bb-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: rgba(255, 255, 255, 0.4);
    transition:
        color var(--duration-fast) var(--ease-out),
        transform var(--duration-fast) var(--ease-out);
}

.bb-footer-social a:hover {
    color: var(--bb-white);
    transform: translateY(-1px);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE FOOTER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 768px) {
    .bb-footer {
        padding: var(--space-8) 0 var(--space-6);
    }

    .bb-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    .bb-footer-brand {
        grid-column: 1 / -1;
    }

    .bb-footer-description {
        max-width: none;
    }

    .bb-footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
        padding-bottom: var(--safe-bottom);
    }
}

@media (max-width: 480px) {
    .bb-footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bb-footer-brand {
        grid-column: 1 / -1;
    }

    .bb-footer-col:last-child {
        grid-column: 1 / -1;
    }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CONTRACT LAYER (P5 step 1, D-298): the footer on the token contract, light and dark,
   plus the theme switch. Only where <html> carries data-theme; other pages keep v1 above.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* the CTA band stays brand green in both themes: white text on --brand (R6) */
html[data-theme] .bb-footer-cta { background: linear-gradient(135deg, var(--bb-green-dark) 0%, var(--brand) 100%); }

html[data-theme] .bb-footer {
    background: var(--site-bg-deep);
    color: var(--ink-2);
    border-top: 1px solid var(--line);
}
html[data-theme] .bb-footer-grid,
html[data-theme] .bb-footer-bottom { border-color: var(--line); }
html[data-theme] .bb-footer-heading { color: var(--ink); }
html[data-theme] .bb-footer-tagline { color: var(--brand-ink); }
html[data-theme] .bb-footer-description { color: var(--ink-2); }
html[data-theme] .bb-footer-links a { color: var(--ink-2); }
html[data-theme] .bb-footer-links a:hover { color: var(--ink); }
html[data-theme] .bb-footer-copyright { color: var(--ink-2); }
html[data-theme] .bb-footer-social a { color: var(--ink-2); }
html[data-theme] .bb-footer-social a:hover { color: var(--ink); }
html[data-theme] .bb-patent-footer { color: var(--brand-ink); border-color: var(--line-2); }

/* ── The theme switch (rendered only on contract pages; hidden until theme.js runs) ── */
.bb-theme-toggle[hidden] { display: none !important; }
html[data-theme] .bb-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: 600 0.85rem/1 var(--site-font-body);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color var(--dur-s) var(--ease-out), background-color var(--dur-s) var(--ease-out);
}
html[data-theme] .bb-theme-toggle:hover { border-color: var(--brand-ink); }
html[data-theme] .bb-theme-toggle:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; }
html[data-theme] .bb-theme-toggle .bb-theme-dot {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: inset 0 0 0 2px var(--surface);
    overflow: hidden;
}
html[data-theme] .bb-theme-toggle .bb-theme-dot::after {
    content: '';
    position: absolute;
    inset: 0 0 0 50%;
    background: var(--surface);
}
html[data-theme="dark"] .bb-theme-toggle .bb-theme-dot::after { inset: 0 50% 0 0; }

/* the CTA band's heading and line stay white on brand green in both themes (R6) */
html[data-theme] .bb-footer-cta-text h3 { color: #FFFFFF; }
html[data-theme] .bb-footer-cta-text p { color: rgba(255, 255, 255, 0.8); }

/* the wordmark in the footer (pass 28: the home page's logo on every contract page) */
html[data-theme] .bb-footer-logo.bb-wordmark { display: inline-block; font-size: 1.25rem; margin-bottom: 10px; }

/* ━━━ The footer's type and rhythm on contract pages (pass 31): the home page's values, exactly ━━━ */
html[data-theme] .bb-footer { margin-top: clamp(40px, 7vh, 70px); padding: clamp(40px, 6vh, 64px) 0 calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 0.9rem; color: var(--ink-2); }
@media (max-width: 859px) { html[data-theme] .bb-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } } /* room for the floating buttons */
html[data-theme] .bb-footer-grid { display: grid; gap: 32px 24px; grid-template-columns: 1fr 1fr; padding: 0; border: 0; margin: 0; }
@media (min-width: 860px) { html[data-theme] .bb-footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
html[data-theme] .bb-footer-brand { grid-column: 1 / -1; }
@media (min-width: 860px) { html[data-theme] .bb-footer-brand { grid-column: auto; } }
html[data-theme] .bb-footer-col:last-child { grid-column: auto; }
html[data-theme] .bb-footer-logo.bb-wordmark { display: inline-block; font-size: 1.15rem; margin: 0 0 10px; }
html[data-theme] .bb-footer-tagline { margin: 0; font: 700 0.72rem/1.4 var(--site-font-disp); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-ink); }
html[data-theme] .bb-footer-description { margin: 10px 0 0; max-width: 34ch; color: var(--ink-2); font-size: 0.9rem; line-height: 1.6; }
html[data-theme] .bb-footer-heading { margin: 0 0 14px; font: 700 0.68rem/1.3 var(--site-font-disp); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); }
html[data-theme] .bb-footer-links { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
html[data-theme] .bb-footer-links li { margin: 0; }
html[data-theme] .bb-footer-links a { color: var(--ink-2); text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; font-size: 0.9rem; padding: 0; }
html[data-theme] .bb-footer-links a:hover { color: var(--ink); }
html[data-theme] .bb-footer-bottom { margin-top: 36px; padding: 22px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px 24px; align-items: center; text-align: left; font-size: 0.82rem; }
html[data-theme] .bb-footer-copyright { margin: 0; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--ink-2); font-size: 0.82rem; }
html[data-theme] .bb-patent-footer { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; margin: 0; border-radius: 999px; border: 1px solid var(--line-2); font: 700 0.62rem/1 var(--site-font-disp); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); background: none; }
html[data-theme] .bb-footer-social { display: inline-flex; gap: 6px; margin-left: auto; }
/* D-342: the airline disclaimer, its own line under the bar */
.bb-footer-disclaimer { order: 9; flex: 1 0 100%; margin: 0; font-size: 0.78rem; line-height: 1.5; color: rgba(255, 255, 255, 0.6); }
html[data-theme] .bb-footer-disclaimer { color: var(--ink-2); font-size: 0.78rem; }
html[data-theme] .bb-footer-social a { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ink-2); }
html[data-theme="light"] .bb-footer-social a { background: rgba(14, 40, 22, 0.04); }
html[data-theme] .bb-footer-social a svg { width: 18px; height: 18px; }
