/* ============================================================
   Language switcher
   ============================================================ */
.lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    font-family: ui-monospace, "IBM Plex Mono", "JetBrains Mono", monospace;
    z-index: 200;
}

.lang-switcher-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 160, 86, 0.35);
    border-radius: 999px;
    color: var(--text-primary, #e6e8ec);
    font: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
    line-height: 1;
}
.lang-switcher-toggle:hover,
.lang-switcher-toggle[aria-expanded="true"] {
    border-color: rgba(212, 160, 86, 0.85);
    background: rgba(212, 160, 86, 0.1);
    color: #d4a056;
}
.lang-switcher-icon {
    display: inline-flex;
    color: #d4a056;
    opacity: 0.85;
}
.lang-switcher-current {
    font-weight: 600;
    letter-spacing: 0.12em;
}
.lang-switcher-caret {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 0.05rem;
    transform: translateY(-0.5px);
}

.lang-switcher-list {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    min-width: 170px;
    background: #11141a;
    border: 1px solid rgba(212, 160, 86, 0.35);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}
.lang-switcher-list.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-switcher-list li {
    list-style: none;
    margin: 0;
}
.lang-switcher-option {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: 0;
    color: var(--text-secondary, #b0b8c0);
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: background 140ms ease, color 140ms ease;
}
.lang-switcher-option:hover {
    background: rgba(212, 160, 86, 0.08);
    color: var(--text-primary, #e6e8ec);
}
.lang-switcher-option.active {
    color: #d4a056;
    background: rgba(212, 160, 86, 0.06);
}
.lang-switcher-code {
    font-weight: 700;
    letter-spacing: 0.1em;
    min-width: 28px;
    color: #d4a056;
    font-size: 0.78rem;
}
.lang-switcher-name {
    font-family: inherit;
}

@media (max-width: 768px) {
    .lang-switcher {
        margin-left: auto;
        margin-right: 0.5rem;
    }
    .lang-switcher-list {
        right: 0;
        left: auto;
    }
}

/* ============================================================
   RTL overrides (Hebrew) — comprehensive
   ============================================================ */
html[dir="rtl"] body { text-align: right; }

/* --- Navbar --- */
html[dir="rtl"] .navbar .container { flex-direction: row-reverse; }
html[dir="rtl"] .nav-menu {
    padding-right: 0;
    flex-direction: row-reverse;
}

/* --- Language switcher --- */
html[dir="rtl"] .lang-switcher {
    margin-left: 0;
    margin-right: 0.75rem;
}
html[dir="rtl"] .lang-switcher-list {
    right: auto;
    left: 0;
}
html[dir="rtl"] .lang-switcher-option { text-align: right; }

/* --- Hero --- */
html[dir="rtl"] .hero-content,
html[dir="rtl"] .hero-content-3d,
html[dir="rtl"] .hero-container-3d,
html[dir="rtl"] .hero-eyebrow,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .hero-subtitle { text-align: right; }
html[dir="rtl"] .hero-cta-row,
html[dir="rtl"] .hero-trust-row { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .hero-cta-secondary span,
html[dir="rtl"] .btn-cta-secondary span {
    display: inline-block;
    transform: scaleX(-1);
}
html[dir="rtl"] .trust-pill { direction: rtl; }

/* --- Section titles & eyebrows --- */
html[dir="rtl"] .section-eyebrow { text-align: right; }
html[dir="rtl"] .section-title-left,
html[dir="rtl"] .section-lead.section-lead-left,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 { text-align: right; }
html[dir="rtl"] .section-title { text-align: center; }
html[dir="rtl"] .section-lead,
html[dir="rtl"] .lead-text,
html[dir="rtl"] .about-lead,
html[dir="rtl"] .contact-intro,
html[dir="rtl"] .problem-takeaway,
html[dir="rtl"] .measure-footnote,
html[dir="rtl"] .specs-note { text-align: right; }

/* --- Stats strip --- */
html[dir="rtl"] .stat-cell,
html[dir="rtl"] .stat-num,
html[dir="rtl"] .stat-label { text-align: center; }

/* --- Problem section / mask demo --- */
html[dir="rtl"] .mask-demo { direction: rtl; }
html[dir="rtl"] .mask-panel,
html[dir="rtl"] .mask-panel-header,
html[dir="rtl"] .mask-panel h3 { text-align: right; }
html[dir="rtl"] .mask-readout { direction: rtl; }
html[dir="rtl"] .readout-row { flex-direction: row-reverse; }
html[dir="rtl"] .readout-note { text-align: right; }

/* --- Solution section --- */
html[dir="rtl"] .solution-content { direction: rtl; }
html[dir="rtl"] .solution-text,
html[dir="rtl"] .solution-text p { text-align: right; }
html[dir="rtl"] .solution-bullets,
html[dir="rtl"] .privacy-bullets,
html[dir="rtl"] .how-step-tags,
html[dir="rtl"] .footer-links ul {
    padding-right: 0;
    list-style: none;
    text-align: right;
}
html[dir="rtl"] .solution-bullets li,
html[dir="rtl"] .privacy-bullets li { text-align: right; }
html[dir="rtl"] .bullet-dot {
    margin-left: 0.6rem;
    margin-right: 0;
}
html[dir="rtl"] .module-card-meta { direction: rtl; }
html[dir="rtl"] .module-caption { text-align: right; }

/* --- Measure section / feature detail --- */
html[dir="rtl"] .measure-stage { direction: rtl; }
html[dir="rtl"] .feature-detail,
html[dir="rtl"] .feature-detail-inner,
html[dir="rtl"] .fd-title,
html[dir="rtl"] .fd-desc { text-align: right; }
html[dir="rtl"] .fd-meta { direction: rtl; }
html[dir="rtl"] .feat-marker-label { direction: rtl; }

/* --- How it works --- */
html[dir="rtl"] .how-steps { direction: rtl; }
html[dir="rtl"] .how-step,
html[dir="rtl"] .how-step h3,
html[dir="rtl"] .how-step p { text-align: right; }
html[dir="rtl"] .how-step-tags { direction: rtl; }

/* --- Use cases --- */
html[dir="rtl"] .usecase-grid { direction: rtl; }
html[dir="rtl"] .usecase-card,
html[dir="rtl"] .usecase-card h3,
html[dir="rtl"] .usecase-card p { text-align: right; }

/* --- Specs --- */
html[dir="rtl"] .specs-table-wrap { direction: rtl; }
html[dir="rtl"] .specs-table th,
html[dir="rtl"] .specs-table td { text-align: right; }

/* --- Privacy --- */
html[dir="rtl"] .privacy-grid { direction: rtl; }
html[dir="rtl"] .privacy-text,
html[dir="rtl"] .privacy-policy-link { text-align: right; }

/* --- About --- */
html[dir="rtl"] .about-section,
html[dir="rtl"] .trust-strip-label { text-align: right; }
html[dir="rtl"] .trust-strip { align-items: stretch; }
html[dir="rtl"] .trust-strip > .trust-strip-label { text-align: center; }

/* --- Contact form --- */
html[dir="rtl"] .contact-form,
html[dir="rtl"] .form-group,
html[dir="rtl"] .form-group label { text-align: right; }
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group textarea,
html[dir="rtl"] .form-group select { text-align: right; direction: rtl; }
html[dir="rtl"] .contact-email { text-align: center; }

/* --- Footer --- */
html[dir="rtl"] .footer-content { direction: rtl; }
html[dir="rtl"] .footer-brand,
html[dir="rtl"] .footer-links,
html[dir="rtl"] .footer-contact,
html[dir="rtl"] .footer-brand p,
html[dir="rtl"] .footer-links h4,
html[dir="rtl"] .footer-contact h4,
html[dir="rtl"] .footer-bottom,
html[dir="rtl"] .footer-bottom p { text-align: right; }
html[dir="rtl"] .footer-links ul,
html[dir="rtl"] .footer-links li { text-align: right; }

/* --- Cookie banner --- */
html[dir="rtl"] .cookie-content { direction: rtl; text-align: right; }
html[dir="rtl"] .cookie-buttons { flex-direction: row-reverse; }

/* --- Policy pages (cookie/privacy) --- */
html[dir="rtl"] .policy-content,
html[dir="rtl"] .policy-content h1,
html[dir="rtl"] .policy-content h2,
html[dir="rtl"] .policy-content h3,
html[dir="rtl"] .policy-content p,
html[dir="rtl"] .policy-content li,
html[dir="rtl"] .last-updated { text-align: right; }
html[dir="rtl"] .policy-content ul {
    margin-left: 0;
    margin-right: 2rem;
}

/* --- Hero scroll cue stays centered horizontally --- */
html[dir="rtl"] .hero-scroll-cue { left: 50%; right: auto; transform: translateX(-50%); }

/* ============================================================
   Mobile navigation menu (hamburger)
   ============================================================ */
@media (max-width: 768px) {
    .navbar .container { position: relative; }

    .hamburger {
        display: flex !important;
        position: relative;
        z-index: 1100;
        padding: 6px;
        background: transparent;
        border: 0;
    }
    .hamburger span {
        display: block;
        transition: transform 250ms ease, opacity 200ms ease;
        transform-origin: center;
    }
    .hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .nav-menu {
        display: none !important;
    }
    .nav-menu.active {
        display: flex !important;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column !important;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 1rem 1.5rem 1.5rem;
        background: rgba(10, 12, 16, 0.98);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        z-index: 1050;
        list-style: none;
    }
    .nav-menu.active li {
        list-style: none;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .nav-menu.active li:last-child { border-bottom: 0; }
    .nav-menu.active a {
        display: block;
        padding: 0.95rem 0.25rem;
        font-size: 1rem;
        color: var(--text-primary, #e6e8ec);
    }
    .nav-menu.active a:hover {
        color: #d4a056;
    }

    /* RTL: menu items right-aligned */
    html[dir="rtl"] .nav-menu.active { text-align: right; }

    /* Show language switcher on mobile beside hamburger */
    .lang-switcher {
        margin-left: auto;
        margin-right: 0.4rem;
    }
    html[dir="rtl"] .lang-switcher {
        margin-right: auto;
        margin-left: 0.4rem;
    }
}

/* ============================================================
   Hero fallback — keep hidden on desktop, show stacked on mobile
   ============================================================ */
.hero-fallback { display: none !important; }

@media (max-width: 1024px) {
    .hero-3d {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        height: auto !important;
        min-height: auto !important;
        padding-top: 90px !important;
        padding-bottom: 2.5rem !important;
    }
    .hero-3d::after {
        background:
            linear-gradient(180deg,
                var(--dark-bg) 0%,
                rgba(10, 12, 16, 0.4) 25%,
                transparent 55%,
                rgba(10, 12, 16, 0.5) 90%,
                var(--dark-bg) 100%) !important;
    }
    .hero-content-3d {
        position: relative !important;
        z-index: 10 !important;
        order: 1 !important;
        padding-bottom: 1.5rem !important;
    }
    .hero-canvas {
        display: none !important;
    }
    .hero-fallback {
        display: flex !important;
        position: relative !important;
        inset: auto !important;
        order: 2 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 280px !important;
        opacity: 1 !important;
        margin-top: 1rem !important;
        z-index: 5 !important;
    }
    .hero-fallback img {
        height: auto !important;
        max-height: 50vh !important;
        width: auto !important;
        max-width: 90% !important;
        object-fit: contain !important;
        filter: brightness(0.9) saturate(1.05) !important;
    }
    .hero-3d .hero-title { font-size: 2.4rem; }
    .hero-3d .hero-subtitle { font-size: 1rem; }
    .hero-container-3d {
        max-width: 100% !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

@media (max-width: 600px) {
    .hero-3d .hero-title { font-size: 1.9rem; }
    .hero-fallback { min-height: 220px !important; }
    .hero-fallback img { max-height: 38vh !important; }
}

/* ============================================================
   Partner / "Working with" logos
   ============================================================ */
.trust-logos {
    align-items: center;
    gap: 2rem !important;
    direction: ltr;
    width: 100%;
    flex-wrap: wrap;
}
.partner-logo {
    width: 180px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.85;
    filter: saturate(0.95);
    transition: opacity 200ms ease, filter 200ms ease, transform 200ms ease;
    direction: ltr;
    flex: 0 0 auto;
}
.partner-logo:hover {
    opacity: 1;
    filter: saturate(1);
    transform: translateY(-1px);
}
.partner-logo svg,
.partner-logo img {
    max-height: 60px;
    max-width: 170px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.partner-logo-img img {
    max-height: 60px !important;
    max-width: 170px !important;
}

@media (max-width: 600px) {
    .trust-logos { gap: 2rem !important; }
    .partner-logo { width: 140px; height: 64px; }
    .partner-logo svg,
    .partner-logo img,
    .partner-logo-img img { max-height: 48px; max-width: 130px; }
}

html[dir="rtl"] .trust-logos,
html[dir="rtl"] .partner-logo { direction: ltr; }

/* Keep brand name LTR even in RTL pages */
.nav-brand,
.nav-brand a,
.footer-brand h3,
.module-name,
.module-version { direction: ltr; unicode-bidi: isolate; }
