/* ============================================
   CORTEX LANDING PAGE STYLES
   Reuses: variables.css, global.css
   ============================================ */

/* --- Header --- */
.cx-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.cx-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.cx-logo img {
    height: 36px;
    width: auto;
}

.cx-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cx-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    letter-spacing: 0.01em;
}

.cx-nav a:hover {
    color: var(--color-text-main);
}

.cx-nav-cta {
    background: var(--gradient-brand);
    color: #fff !important;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600 !important;
    font-size: 0.875rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-glow);
}

.cx-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px -12px rgba(139, 92, 246, 0.5);
}

/* Mobile menu toggle */
.cx-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.cx-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s ease;
}

/* --- Hero --- */
.cx-hero {
    padding: calc(var(--header-height) + 4rem) 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cx-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.cx-hero .container {
    position: relative;
    z-index: 1;
}

/* SaaS Pill Badge */
.cx-pill {
    display: inline-block;
    padding: 0.4rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.08);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
}

.cx-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.cx-hero-title .cx-highlight {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cx-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-muted);
    max-width: 580px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* --- Email Form --- */
.cx-email-form {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 520px;
    margin: 0 auto 1rem;
    background: var(--color-surface);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-full);
    padding: 5px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cx-email-form:focus-within {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 30px -8px rgba(139, 92, 246, 0.2);
}

.cx-email-form input[type="email"] {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-main);
    font-family: var(--font-body);
}

.cx-email-form input[type="email"]::placeholder {
    color: rgba(161, 161, 170, 0.6);
}

.cx-email-form button {
    background: var(--gradient-brand);
    color: #fff;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-body);
}

.cx-email-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 40px -10px rgba(139, 92, 246, 0.4);
}

.cx-email-form .cx-form-success {
    display: none;
    color: #22C55E;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.85rem 1.25rem;
    width: 100%;
    text-align: center;
}

.cx-email-form.success input,
.cx-email-form.success button {
    display: none;
}

.cx-email-form.success .cx-form-success {
    display: block;
}

.cx-subtext {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    opacity: 0.7;
    text-align: center;
}

.cx-subtext span {
    margin: 0 0.4rem;
}

/* --- Trust Marquee (matching original site style with fade edges) --- */
.cx-hero .marquee {
    --marquee-height: 80px;
    --rail-gap: 60px;
    --logo-max-h: 36px;
    --speed: 100s;
    position: relative;
    width: 100%;
    height: var(--marquee-height);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0;
    /* Fade edges into background for premium look */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.cx-hero .track {
    display: flex;
    align-items: center;
    gap: var(--rail-gap);
    will-change: transform;
    animation: cx-marquee-scroll var(--speed) linear infinite;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cx-hero .logo-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--marquee-height) - 16px);
    min-width: 100px;
    padding: 0;
    margin: 0;
}

.cx-hero .logo-item img {
    display: block;
    max-height: var(--logo-max-h);
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.7);
    transition: opacity 0.3s, filter 0.3s;
}

.cx-hero .marquee-disclaimer {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
    margin-top: 1rem;
    opacity: 0.6;
    font-style: italic;
}

@keyframes cx-marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Section Shared --- */
.cx-section {
    padding: 5rem 0;
}

.text-center {
    text-align: center;
}

.cx-section-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    display: inline-block;
}

.cx-section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.cx-title-xl {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.cx-section-desc {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    max-width: 640px;
}

.cx-section.text-center .cx-section-desc {
    margin: 0 auto;
}

/* --- What is Cortex --- */
.cx-what {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- How It Works --- */
.cx-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.cx-step-card {
    background: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 2rem;
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease;
    text-align: center;
}

.cx-step-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-4px);
}

.cx-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 1.25rem;
}

.cx-step-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cx-step-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* --- Complete Ecosystem --- */
.cx-ecosystem {
    background: var(--color-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cx-ecosystem .cx-section-desc {
    margin-bottom: 2.5rem;
}

/* --- FAQ --- */
.cx-faq {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cx-faq-grid {
    max-width: 720px;
    margin: 2.5rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cx-faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cx-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-main);
    list-style: none;
    transition: color 0.2s ease;
}

.cx-faq-question::-webkit-details-marker {
    display: none;
}

.cx-faq-question::marker {
    display: none;
    content: '';
}

.cx-faq-question:hover {
    color: var(--color-primary);
}

.cx-faq-icon {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
    margin-left: 1rem;
}

.cx-faq-icon::before,
.cx-faq-icon::after {
    content: '';
    position: absolute;
    background: var(--color-text-muted);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.cx-faq-icon::before {
    width: 14px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cx-faq-icon::after {
    width: 2px;
    height: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cx-faq-item[open] .cx-faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

.cx-faq-answer {
    padding: 0 0 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* --- Footer --- */
.cx-footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cx-footer-cta {
    text-align: center;
    margin-bottom: 3rem;
}

.cx-footer-cta .cx-section-title {
    margin-bottom: 1.5rem;
}

.cx-footer-legal {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cx-footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cx-footer-links a {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
}

.cx-footer-links a:hover {
    color: var(--color-text-main);
}

.cx-footer-links .separator {
    color: rgba(161, 161, 170, 0.3);
}

.cx-copyright {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cx-mobile-toggle {
        display: flex;
    }

    .cx-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: #111;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid rgba(255, 255, 255, 0.06);
    }

    .cx-nav.open {
        right: 0;
    }

    .cx-nav a {
        font-size: 1.1rem;
    }

    .cx-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
    }

    .cx-nav-backdrop.open {
        display: block;
    }

    .cx-hero {
        padding: calc(var(--header-height) + 2rem) 0 2rem;
    }

    .cx-hero-title {
        font-size: 2rem;
    }

    .cx-email-form {
        flex-direction: column;
        border-radius: 0;
        padding: 0;
        gap: 0.75rem;
        background: none;
        border: none;
        box-shadow: none;
    }

    .cx-email-form:focus-within {
        border-color: transparent;
        box-shadow: none;
    }

    .cx-email-form input[type="email"] {
        width: 100%;
        text-align: center;
        padding: 0.85rem 1rem;
        background: var(--color-surface);
        border: 1px solid rgba(139, 92, 246, 0.25);
        border-radius: var(--radius-full);
    }

    .cx-email-form button {
        width: 100%;
        border-radius: var(--radius-full);
        padding: 0.85rem 1.5rem;
    }

    .cx-steps-grid {
        grid-template-columns: 1fr;
    }

    .cx-trust-logo img {
        height: 24px;
        max-width: 90px;
    }

    .cx-trust-track {
        gap: 2.5rem;
    }

    .cx-section {
        padding: 3rem 0;
    }

    .cx-section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .cx-hero-title {
        font-size: 1.65rem;
    }

    .cx-hero-subtitle {
        font-size: 0.95rem;
    }

    .cx-step-card {
        padding: 1.5rem;
    }
}
