/* CODFIX v5.12.1 HF1 — Full Dark Mode + Hero Typography */

/* Hero: slightly smaller, more breathing room, especially for Arabic. */
.cfx5121-hero-copy h1 {
    font-size: clamp(2.65rem, 4.45vw, 4.75rem) !important;
    line-height: 1.34 !important;
    letter-spacing: -0.025em !important;
    max-width: 14ch;
    margin-block: 16px 18px !important;
}

[dir="rtl"] .cfx5121-hero-copy h1,
[lang="ar"] .cfx5121-hero-copy h1 {
    letter-spacing: 0 !important;
    word-spacing: 0.035em;
    line-height: 1.42 !important;
    max-width: 15.5ch;
}

.cfx5121-hero-copy h2 {
    line-height: 1.8 !important;
    margin-bottom: 14px !important;
}

.cfx5121-hero-copy p {
    font-size: clamp(1.12rem, 1.38vw, 1.28rem) !important;
    line-height: 2.05 !important;
}

@media (max-width: 760px) {
    .cfx5121-hero-copy h1 {
        font-size: clamp(2.15rem, 9.2vw, 3.15rem) !important;
        line-height: 1.38 !important;
        max-width: 100%;
    }

    [dir="rtl"] .cfx5121-hero-copy h1,
    [lang="ar"] .cfx5121-hero-copy h1 {
        line-height: 1.46 !important;
        max-width: 100%;
    }
}

/* Full-site dark palette. Loaded after all page-specific CSS. */
html[data-theme="dark"] {
    color-scheme: dark;
    --cfx5121-ink: #f8fafc;
    --cfx5121-text: #cbd5e1;
    --cfx5121-line: #263244;
    --cfx5121-soft: #101827;
    --cfx5121-dark: #070d18;
    --cfx5121-shadow: 0 28px 85px rgba(0, 0, 0, .34);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .cfx32-body {
    background: #0a101c !important;
    color: #d5dce7 !important;
}

html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
    opacity: .28;
}

/* Header, navigation, mega menu and controls. */
html[data-theme="dark"] .cfx5121-header,
html[data-theme="dark"] .cfx32-header {
    background: rgba(9, 15, 27, .94) !important;
    border-color: #202b3a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx32-nav a,
html[data-theme="dark"] .cfx5121-nav > a,
html[data-theme="dark"] .cfx5121-mega-trigger,
html[data-theme="dark"] .cfx32-icon-action {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .cfx32-icon-action,
html[data-theme="dark"] .cfx32-language-trigger {
    background: #111a2a !important;
    border-color: #293548 !important;
}

html[data-theme="dark"] .cfx32-language-menu,
html[data-theme="dark"] .cfx5121-mega,
html[data-theme="dark"] .cfx5121-search-box {
    background: #0f1726 !important;
    border-color: #263244 !important;
    box-shadow: 0 28px 65px rgba(0, 0, 0, .38) !important;
}

html[data-theme="dark"] .cfx32-language-menu a,
html[data-theme="dark"] .cfx5121-mega-grid > div > a {
    border-color: #263244 !important;
}

html[data-theme="dark"] .cfx5121-mega-grid a strong,
html[data-theme="dark"] .cfx5121-search-box h2,
html[data-theme="dark"] .cfx32-language-menu strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-mega-grid a small,
html[data-theme="dark"] .cfx32-language-menu small {
    color: #9aa7b9 !important;
}

/* Hero. */
html[data-theme="dark"] .cfx5121-hero,
html[data-theme="dark"] .hero-section,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .cfx500-inner-hero,
html[data-theme="dark"] .cfx510-detail-hero,
html[data-theme="dark"] .cfx520-product-hero,
html[data-theme="dark"] .cfx540-static-hero,
html[data-theme="dark"] .cfx5120-contact-hero,
html[data-theme="dark"] .cfx5121-search-page-hero {
    background: linear-gradient(180deg, #0b1321 0%, #0a101c 100%) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-hero-copy h1,
html[data-theme="dark"] .cfx5121-hero-copy h2,
html[data-theme="dark"] .cfx500-hero-copy h1,
html[data-theme="dark"] .cfx510-detail-copy h1,
html[data-theme="dark"] .cfx520-product-hero-copy h1,
html[data-theme="dark"] .cfx540-static-hero-copy h1,
html[data-theme="dark"] .cfx5120-contact-copy h1,
html[data-theme="dark"] .page-hero h1,
html[data-theme="dark"] .hero-section h1,
html[data-theme="dark"] .cfx5121-search-page-hero h1 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-hero-copy p,
html[data-theme="dark"] .cfx5121-trust-inline,
html[data-theme="dark"] .cfx500-hero-copy p,
html[data-theme="dark"] .cfx510-detail-copy > p,
html[data-theme="dark"] .cfx520-product-tagline,
html[data-theme="dark"] .cfx540-static-hero-copy > p,
html[data-theme="dark"] .cfx5120-contact-copy p,
html[data-theme="dark"] .hero-lead,
html[data-theme="dark"] .page-hero p {
    color: #b8c2d1 !important;
}

html[data-theme="dark"] .cfx5121-actions .secondary,
html[data-theme="dark"] .cfx510-detail-actions .secondary,
html[data-theme="dark"] .cfx520-product-actions .secondary {
    background: #111b2b !important;
    color: #f8fafc !important;
    border-color: #344054 !important;
}

/* Browser/system mockups in Hero. */
html[data-theme="dark"] .cfx5121-browser-mockup,
html[data-theme="dark"] .cfx5121-floating-card,
html[data-theme="dark"] .cfx5120-hero-image,
html[data-theme="dark"] .cfx5120-contact-visual img,
html[data-theme="dark"] .cfx500-hero-visual img,
html[data-theme="dark"] .cfx510-detail-visual img,
html[data-theme="dark"] .cfx520-product-hero-visual img {
    background: #111827 !important;
    border-color: #293548 !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38) !important;
}

html[data-theme="dark"] .cfx5121-browser-mockup .bar,
html[data-theme="dark"] .mock-chart {
    background: #151f30 !important;
    border-color: #293548 !important;
}

html[data-theme="dark"] .cfx5121-browser-mockup main {
    background: #0f1726 !important;
}

html[data-theme="dark"] .mock-title,
html[data-theme="dark"] .mock-rows span {
    background: #334155 !important;
}

html[data-theme="dark"] .mock-stats i {
    background: #1d2738 !important;
    border-color: #9a4d18 !important;
}

html[data-theme="dark"] .cfx5121-floating-card small {
    color: #aeb9c8 !important;
}

html[data-theme="dark"] .cfx5121-slider-controls > button {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #344054 !important;
}

/* Main page sections. */
html[data-theme="dark"] .cfx5121-stats,
html[data-theme="dark"] .cfx5121-section,
html[data-theme="dark"] .cfx5121-section.soft,
html[data-theme="dark"] .cfx5121-section.saas,
html[data-theme="dark"] .cfx5121-cta,
html[data-theme="dark"] .section,
html[data-theme="dark"] .section-muted,
html[data-theme="dark"] main,
html[data-theme="dark"] .cfx500-about,
html[data-theme="dark"] .cfx510-service-detail,
html[data-theme="dark"] .cfx520-product-detail,
html[data-theme="dark"] .cfx540-static-page {
    background: #0a101c !important;
    color: #d5dce7 !important;
    border-color: #202b3a !important;
}

html[data-theme="dark"] .cfx5121-section.soft,
html[data-theme="dark"] .section-muted,
html[data-theme="dark"] .cfx510-detail-section.soft {
    background: #0f1726 !important;
}

html[data-theme="dark"] .cfx5121-section.saas {
    background: linear-gradient(135deg, #111827 0%, #0a101c 100%) !important;
}

html[data-theme="dark"] .cfx5121-stats {
    border-color: #202b3a !important;
}

html[data-theme="dark"] .cfx5121-stats article {
    border-color: #202b3a !important;
}

html[data-theme="dark"] .cfx5121-stats strong,
html[data-theme="dark"] .cfx5121-section-head h2,
html[data-theme="dark"] .cfx5121-why-intro h2,
html[data-theme="dark"] .cfx5121-saas-wrap h2,
html[data-theme="dark"] .cfx5121-faq-grid h2,
html[data-theme="dark"] .section h2,
html[data-theme="dark"] .section h3,
html[data-theme="dark"] .cfx500-about h2,
html[data-theme="dark"] .cfx500-about h3,
html[data-theme="dark"] .cfx510-service-detail h2,
html[data-theme="dark"] .cfx510-service-detail h3,
html[data-theme="dark"] .cfx520-product-detail h2,
html[data-theme="dark"] .cfx520-product-detail h3,
html[data-theme="dark"] .cfx540-static-page h2,
html[data-theme="dark"] .cfx540-static-page h3 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-stats span,
html[data-theme="dark"] .cfx5121-why-intro > p,
html[data-theme="dark"] .cfx5121-saas-wrap .copy p,
html[data-theme="dark"] .cfx5121-faq-grid > div:first-child p,
html[data-theme="dark"] .section-lead,
html[data-theme="dark"] .prose,
html[data-theme="dark"] .prose p,
html[data-theme="dark"] .cfx540-prose,
html[data-theme="dark"] .cfx510-detail-intro p,
html[data-theme="dark"] .cfx510-section-head p {
    color: #b8c2d1 !important;
}

/* Cards and grids. */
html[data-theme="dark"] .cfx5121-product-card,
html[data-theme="dark"] .cfx5121-service-card,
html[data-theme="dark"] .cfx5121-why-list article,
html[data-theme="dark"] .cfx5121-work-card,
html[data-theme="dark"] .cfx5121-saas-stack a,
html[data-theme="dark"] .cfx5121-testimonials article,
html[data-theme="dark"] .cfx5121-tech-grid article,
html[data-theme="dark"] .cfx5121-search-results a,
html[data-theme="dark"] .card,
html[data-theme="dark"] .cfx510-feature-grid article,
html[data-theme="dark"] .cfx520-feature-grid article,
html[data-theme="dark"] .cfx500-process-grid article,
html[data-theme="dark"] .cfx5120-contact-card {
    background: #111a2a !important;
    border-color: #293548 !important;
    color: #e5e7eb !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .16) !important;
}

html[data-theme="dark"] .cfx5121-product-card .visual,
html[data-theme="dark"] .cfx5121-work-card .visual,
html[data-theme="dark"] .mini-mock {
    background: #172133 !important;
}

html[data-theme="dark"] .cfx5121-product-card h3,
html[data-theme="dark"] .cfx5121-service-card h3,
html[data-theme="dark"] .cfx5121-why-list h3,
html[data-theme="dark"] .cfx5121-work-card h3,
html[data-theme="dark"] .cfx5121-saas-stack strong,
html[data-theme="dark"] .cfx5121-testimonials footer strong,
html[data-theme="dark"] .cfx5121-tech-grid strong,
html[data-theme="dark"] .cfx5121-search-results strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-product-card p,
html[data-theme="dark"] .cfx5121-service-card p,
html[data-theme="dark"] .cfx5121-why-list p,
html[data-theme="dark"] .cfx5121-work-card p,
html[data-theme="dark"] .cfx5121-saas-stack small,
html[data-theme="dark"] .cfx5121-testimonials blockquote,
html[data-theme="dark"] .cfx5121-search-results p {
    color: #b3becd !important;
}

html[data-theme="dark"] .cfx5121-why-list article > span {
    background: #2a1d15 !important;
}

/* Process section keeps its intentionally darker visual. */
html[data-theme="dark"] .cfx5121-section.dark {
    background: #060b14 !important;
}

html[data-theme="dark"] .cfx5121-process article {
    background: #0f1726 !important;
    border-color: #263244 !important;
}

html[data-theme="dark"] .cfx5121-process h3 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-process p {
    color: #aeb9c8 !important;
}

/* FAQ. */
html[data-theme="dark"] .cfx5121-faq-grid details,
html[data-theme="dark"] details {
    border-color: #293548 !important;
}

html[data-theme="dark"] .cfx5121-faq-grid summary,
html[data-theme="dark"] summary {
    color: #f8fafc !important;
}

html[data-theme="dark"] .cfx5121-faq-grid details p,
html[data-theme="dark"] details p {
    color: #b8c2d1 !important;
}

/* Forms and search. */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .cfx5121-search-box input,
html[data-theme="dark"] .cfx5121-search-page-hero input {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #344054 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #7f8ba0 !important;
}

html[data-theme="dark"] .cfx5121-search-summary {
    background: #2b1c12 !important;
    color: #fdba74 !important;
}

html[data-theme="dark"] .cfx5121-search-empty {
    color: #aeb9c8 !important;
    border-color: #344054 !important;
}

/* Breadcrumbs and generic links. */
html[data-theme="dark"] .cfx500-breadcrumb,
html[data-theme="dark"] .cfx500-breadcrumb a,
html[data-theme="dark"] .cfx500-breadcrumb strong {
    color: #aeb9c8 !important;
}

html[data-theme="dark"] .cfx500-breadcrumb strong {
    color: #e5e7eb !important;
}

/* Footer remains deliberately the darkest surface. */
html[data-theme="dark"] .cfx5121-footer,
html[data-theme="dark"] .cfx32-footer {
    background: #050a12 !important;
    border-color: #202b3a !important;
}

/* Avoid old light decorative layers bleeding into dark mode. */
html[data-theme="dark"] .cfx32-noise,
html[data-theme="dark"] .cfx32-global-fx {
    opacity: .24 !important;
}
