:root {
    /* Brand Tokens */
    --bg-core: #0B1A2E;         /* Midnight Blue */
    --accent-velocity: #1E70FE; /* Cobalt Blue */
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --surface-solid: #16263D;    /* Solid UI background */
    --radius-std: 8px;
    --header-height: 70px;
    --footer-dock-height: 86px;
}

/* 1. Global Reset & Depth Management */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-core);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* 2. THE CONVERGING HORIZON (Background Layer) */
.horizon-grid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* CRITICAL: Must be negative to sit behind all content */
    pointer-events: none;
    background-image: url('assets/bg-warp.svg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    opacity: 1;
}

/* 3. Navigation Header (Top Layer) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: var(--header-height);
    background: var(--bg-core);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensures it stays above all main content */
}

.logo-container { display: flex; align-items: center; gap: 12px; }
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}
.nav-logo { height: 32px; width: 32px; }
.brand-text { font-weight: 700; font-size: 1.1rem; }
.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.header-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.9;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.header-link:hover,
.header-link.active {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.header-cta {
    background: var(--accent-velocity);
    opacity: 1;
    padding: 10px 14px;
}

.header-cta:hover {
    background-color: #0056e0;
}

/* 4. Content Visibility & Layering */
main { 
    flex: 1 0 auto;
    position: relative; 
    z-index: 10; /* Forces all children to sit above the background */
}

.hero-section {
    padding: 100px 24px 60px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* Text must have maximum contrast */
.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 24px;
}

.hero-sub {
    color: #FFFFFF;
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 40px;
}

/* 5. The CTA Button (Primary Action) */
.cta-button {
    display: inline-block;
    background-color: var(--accent-velocity);
    color: white !important; /* Force visibility */
    text-decoration: none;
    padding: 18px 36px;
    font-weight: 700;
    border-radius: var(--radius-std);
    cursor: pointer;
    position: relative;
    z-index: 20; /* Highest priority */
    transition: transform 0.2s ease, background 0.2s ease;
}

.cta-button:hover { background-color: #0056e0; transform: translateY(-2px); }

.mobile-sticky-cta {
    display: none !important;
}

/* Section heading for service cards */
.section-heading {
    text-align: center;
    margin: 0 auto 22px;
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(11, 26, 46, 0.35);
    backdrop-filter: blur(10px);
}

/* 6. The Briefing Cards (Forced Opacity) */
.pillars-section {
    padding: 40px 24px 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.pillar-card {
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 32px;
    border-radius: var(--radius-std);
    opacity: 1 !important; /* REMOVES the "invisible until hover" error */
    visibility: visible !important;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pillar-card:hover {
    border-color: var(--accent-velocity);
    transform: translateY(-4px);
}

.pillar-card h3 { color: var(--accent-velocity); margin-bottom: 12px; }
.pillar-card p { color: #FFFFFF; } /* Ensure text inside is white */

/* 6b. About Page */
.about-section {
    padding: 56px 24px 100px;
    max-width: 1320px;
    margin: 0 auto;
}
.about-hero-card {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    padding: 28px;
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-std);
    margin-bottom: 28px;
    align-items: center;
}
.about-hero-copy h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
    margin-bottom: 14px;
}
.about-hero-copy p {
    color: #FFFFFF;
    line-height: 1.6;
    max-width: 70ch;
}
.about-hero-media {
    margin: 0;
    align-self: center;
    position: static;
}

.about-hero-media-img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    /* Vertically center within the frame */
    object-position: center 50%;
    border-radius: var(--radius-std);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 24px;
}
.about-summary-card {
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-std);
    padding: 26px;
    max-width: 900px;
    margin: 0 auto;
}
.about-summary-card p {
    color: #FFFFFF;
    line-height: 1.7;
}
.about-people-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.about-person-card {
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-std);
    padding: 18px;
}
.about-person-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #FFFFFF;
}
.about-person-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* 7. Intake Form */
.intake-section { padding: 80px 24px; max-width: 600px; margin: 0 auto; }
.form-container {
    background: var(--surface-solid);
    padding: 48px;
    border-radius: var(--radius-std);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group { position: relative; margin-bottom: 32px; }
.input-group input, .input-group textarea {
    width: 100%;
    padding: 18px;
    background: var(--bg-core);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    font-weight: inherit;
    outline: none;
}

.input-group label {
    position: absolute;
    left: 18px;
    top: 18px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: 0.2s ease all;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: -12px;
    left: 12px;
    font-size: 0.75rem;
    background: var(--surface-solid);
    color: var(--accent-velocity);
    padding: 0 6px;
}

.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -12px;
    left: 12px;
    font-size: 0.75rem;
    background: var(--surface-solid);
    color: var(--accent-velocity);
    padding: 0 6px;
}

.consent-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: -8px 0 24px;
}

.consent-checkbox {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-velocity);
    flex: 0 0 auto;
}

.consent-label {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.consent-link {
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.consent-link:hover {
    color: var(--accent-velocity);
}

.app-footer {
    text-align: center;
    padding: 60px 24px;
    background: var(--bg-core);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    margin-top: auto;
}

.app-footer p + p {
    margin-top: 8px;
}

.footer-legal {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-primary);
    opacity: 0.9;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 0.92rem;
}

.footer-link:hover {
    color: var(--accent-velocity);
}

.footer-sep {
    color: var(--text-secondary);
    opacity: 0.8;
    user-select: none;
}

.legal-page-section {
    padding: 56px 24px 100px;
    max-width: 900px;
    margin: 0 auto;
}

.legal-card {
    background: var(--surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-std);
    padding: 32px;
}

.legal-card h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 12px;
}

.legal-updated {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 28px;
}

.legal-card h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--accent-velocity);
}

.legal-card p {
    color: #FFFFFF;
    line-height: 1.7;
}

.legal-card p + p {
    margin-top: 10px;
}

.legal-card ul {
    margin: 8px 0 0 22px;
}

.legal-card li {
    color: #FFFFFF;
    line-height: 1.7;
}

.legal-card li + li {
    margin-top: 6px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 96px;
    }

    .hero-section {
        padding-top: 20px;
    }

    .hero-content .cta-button {
        display: none;
    }

    .mobile-sticky-cta {
        display: block !important;
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        text-align: center;
        z-index: 1100;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }

    .brand-text {
        font-size: 1rem;
    }

    .header-nav {
        gap: 8px;
    }

    .header-link {
        font-size: 0.85rem;
        padding: 6px 8px;
    }

    .header-cta {
        display: none;
    }

    .about-section {
        padding-top: 28px;
    }

    .about-hero-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .about-hero-media-img {
        aspect-ratio: 4 / 3;
    }

    .about-hero-media {
        position: static;
        top: auto;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-people-grid {
        grid-template-columns: 1fr;
    }

    .legal-card {
        padding: 24px;
    }
}

/* Docked footer on desktop: stays visible while scrolling (avoid mobile sticky CTA overlap). */
@media (min-width: 769px) {
    body {
        padding-bottom: var(--footer-dock-height);
    }

    .app-footer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin-top: 0;
        padding: 18px 24px;
        min-height: var(--footer-dock-height);
        backdrop-filter: blur(10px);
        background: rgba(11, 26, 46, 0.92);
    }
}
