/* ==========================================================================
   Navigation + Footer Components
   ==========================================================================
   This file consumes brand tokens from brand.css. Do NOT introduce new hex
   values or font names here — add them to brand.css first.

   B2B professional styling matching Kepler branding
   ========================================================================== */

/* ── Site Header ─────────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--color-border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    color: var(--color-text);
    font-weight: 700;
}

.site-header .logo-icon {
    width: 34px;
    height: 34px;
    background: var(--color-primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
    box-shadow: var(--shadow-primary);
    /* Fallback: use image if available */
    background-image: url('/static/branding/kepler-logo.png');
    background-size: cover;
    background-position: center;
}

.site-header .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* Nav Links */
.site-header .nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.site-header .nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
}

.site-header .nav-link:hover {
    color: var(--color-text);
}

/* Header CTA */
.site-header .nav-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Responsive: Mobile Menu Toggle */
.site-header .mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 8px;
}

.site-header .mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Panel */
.site-header .mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    flex-direction: column;
    gap: 16px;
}

.site-header .mobile-menu.open {
    display: flex;
}

.site-header .mobile-menu .nav-link {
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.site-header .mobile-menu .nav-link:last-of-type {
    border-bottom: none;
}

.site-header .mobile-menu .btn-primary-sm {
    margin-top: 8px;
    text-align: center;
}

/* ── Site Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 64px 0 40px;
    border-top: 1px solid var(--glass-border, rgba(246, 241, 229, 0.08));
    background: var(--bg-secondary, #1a1410);
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 48px;
}

.site-footer .footer-col h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary, #f6f1e5);
    margin-bottom: 16px;
}

.site-footer .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-footer .footer-col a {
    color: var(--text-secondary, rgba(246, 241, 229, 0.65));
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.site-footer .footer-col a:hover {
    color: var(--text-primary, #f6f1e5);
}

/* Footer Logo */
.site-footer .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 16px;
}

.site-footer .footer-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-primary, #d97706);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('/static/branding/kepler-logo.png');
    background-size: cover;
    background-position: center;
}

.site-footer .footer-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #f6f1e5);
}

.site-footer .footer-about {
    font-size: 0.85rem;
    color: var(--text-secondary, rgba(246, 241, 229, 0.65));
    line-height: 1.6;
    max-width: 240px;
}

/* Footer Bottom */
.site-footer .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border, rgba(246, 241, 229, 0.08));
    flex-wrap: wrap;
    gap: 16px;
}

.site-footer .footer-copyright {
    font-size: 0.85rem;
    color: var(--text-tertiary, rgba(246, 241, 229, 0.45));
}

.site-footer .footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-tertiary, rgba(246, 241, 229, 0.45));
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer .footer-status:hover {
    color: var(--text-primary, #f6f1e5);
}

.site-footer .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green, #10b981);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Status-driven color variants — set by inline script after /api/health/v2 fetch */
.site-footer .status-dot[data-status="loading"] {
    background: var(--color-text-muted, #71717a);
    box-shadow: none;
}

.site-footer .status-dot[data-status="ok"] {
    background: var(--accent-green, #10b981);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.site-footer .status-dot[data-status="degraded"] {
    background: var(--color-warning, #f59e0b);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.site-footer .status-dot[data-status="outage"] {
    background: var(--color-danger, #ef4444);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .site-header .nav-links {
        display: none;
    }
    
    .site-header .nav-cta {
        display: none;
    }
    
    .site-header .mobile-toggle {
        display: flex;
    }
    
    .site-header .mobile-menu {
        display: none;
    }
    
    .site-footer .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    .site-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .site-footer .footer-copyright,
    .site-footer .footer-status {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-footer .footer-grid {
        grid-template-columns: 1fr;
    }
}


/* ── Comparison Table Icons & Badges ─────────────────────────────── */
/* Bare icons, no box around them. Smaller size. */
.comparison-table .icon-check,
.comparison-table .icon-x,
.comparison-table svg.icon-check,
.comparison-table svg.icon-x {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ✗ stays bare (negative state — should not draw attention) */
.comparison-table span.icon-x {
    display: inline;
    background: none;
    padding: 0;
    border: 0;
    width: auto;
    height: auto;
}

/* ✓ wraps in a brand-yellow pill so Kepler wins POP visually */
.comparison-table span.icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 0;
    width: auto;
    height: auto;
}

/* SVG itself gets the visible glyph — yellow check (brand), muted x */
.comparison-table svg.icon-check {
    color: var(--color-primary);
}

.comparison-table svg.icon-x {
    color: var(--color-text-muted);
    opacity: 0.45;
}

.comparison-table .badge-partial {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.comparison-table .badge-planned {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.comparison-table .col-kepler,
.comparison-table .kepler-col {
    background-color: rgba(245, 158, 11, 0.06);
}

/* Accessibility: visually hidden screen reader text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Pipeline Visualization (How it Works — 12-phase Apex) ─────────────── */
.pipeline-viz {
    margin-top: 56px;
    padding-top: 36px;
    border-top: 1px solid var(--color-border);
}

.pipeline-viz-heading {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 28px;
}

.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pipeline-stage {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 18px 12px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pipeline-stage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.stage-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #92400e;
    margin-bottom: 10px;
}

.stage-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.pipeline-gate {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
}

.gate-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.4), transparent);
    min-width: 40px;
}

.gate-label {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pipeline-stages {
        grid-template-columns: repeat(2, 1fr);
    }
    .pipeline-stage {
        padding: 14px 10px;
    }
    .pipeline-gate {
        flex-direction: column;
        gap: 10px;
    }
    .gate-line {
        width: 60%;
    }
    .gate-label {
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
}

/* ── Developer Integration Section ─────────────────────────────── */
.dev-integration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 40px;
}

@media (min-width: 900px) {
    .dev-integration-grid {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
    }
}

.connector-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .connector-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.connector-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
}

.connector-card:hover {
    border-color: var(--color-primary-soft);
    box-shadow: var(--shadow-md);
}

.connector-icon {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.connector-card h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 8px;
    color: var(--color-text);
}

.connector-card p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Code Panel */
.code-panel {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.code-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.code-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.code-tab:hover {
    color: var(--color-text);
}

.code-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.code-block {
    display: none;
    padding: 20px;
    margin: 0;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    background: var(--color-bg);
    color: var(--color-text);
    white-space: pre;
    overflow-x: auto;
}

.code-block.active {
    display: block;
}

/* ── Feature Card Three-Tier Hierarchy (Platform Section) ─────────────────────── */
.feature-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.feature-primitive {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 10px;
    line-height: 1.4;
}
.feature-outcome {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}
