/* Custom Styles for things Tailwind can't easily do via CDN */

/*
 * Mobile menu: must work before Tailwind CDN finishes (otherwise menu covers the page on phones).
 */
#mobile-menu-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

#mobile-menu-btn svg,
#mobile-menu-btn i {
    pointer-events: none;
}

#mobile-menu {
    display: none !important;
    height: 550px;
}

@media (min-width: 1024px) {
    #mobile-menu {
        display: none !important;
    }
}

@media (max-width: 1679px) {
    #mobile-menu.mobile-menu--open {
        display: block !important;
        visibility: visible !important;
        max-height: min(85dvh, calc(100dvh - 5rem));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto;
    }

    #mobile-menu:not(.mobile-menu--open),
    #mobile-menu[hidden] {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
        border-width: 0;
    }
}

/* Module/detail pages: header offset — hero is <section>, not <div> */
main.module-detail-page > section.module-hero-gradient:first-child {
    padding-top: 5rem;
}

@media (min-width: 1024px) {
    main.module-detail-page > section.module-hero-gradient:first-child {
        padding-top: 5rem;
    }
}

/* Module/detail pages: visible even if Tailwind utilities are delayed */
.module-detail-page {
    display: block;
    visibility: visible;
    width: 100%;
    max-width: 100%;
    color: #0f172a;
    overflow-x: clip;
}

.module-detail-page section {
    visibility: visible;
}

/* Responsive foundation */
.decorative-blur {
    width: min(100vw, var(--blur-size, 600px));
    height: min(100vw, var(--blur-size, 600px));
    pointer-events: none;
}

.media-safe img,
.media-safe video {
    max-width: 100%;
    height: auto;
}

.prose-safe {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#showcase-bg-shape {
    width: min(100vw, 600px);
    height: min(100vw, 600px);
}

main.module-detail-page {
    min-width: 0;
    position: relative;
    z-index: 0;
}

.section-blur {
    width: min(100vw, var(--blur-size, 600px));
    height: min(100vw, var(--blur-size, 600px));
    pointer-events: none;
}

@media (max-width: 639px) {
    .hero-orb-1 {
        width: 72px;
        height: 72px;
        right: 4%;
    }
    .hero-orb-2 {
        width: 56px;
        height: 56px;
        left: 4%;
    }
    .hero-orb-3 {
        width: 44px;
        height: 44px;
    }
    #mobile-menu .header-lang-dropdown .dropdown-menu {
        position: static;
        margin-top: 0.5rem;
        box-shadow: none;
        border: 1px solid rgb(226 232 240);
    }
}

html {
    overflow-x: hidden;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    font-size: 1rem;
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
main,
article {
    font-size: 1rem;
}
/* SEO readability: main body copy at least 16px (includes text-sm paragraphs) */
main :is(p, li, dd, blockquote, figcaption):not(.uppercase):not([class*="tracking-widest"]),
article :is(p, li, dd, blockquote, figcaption):not(.uppercase):not([class*="tracking-widest"]) {
    font-size: max(1rem, 16px);
}
/* Kicker / badge labels may stay smaller */
main :is(span, p):is(.uppercase, [class*="tracking-widest"]),
article :is(span, p):is(.uppercase, [class*="tracking-widest"]) {
    font-size: max(0.875rem, 14px);
}
@media (max-width: 639px) {
    .marquee-wrapper {
        gap: 1rem;
    }
    .marquee-content {
        gap: 1.5rem;
    }
    .marquee-content img {
        height: 44px;
        max-width: 140px;
    }
}

/* Hide scrollbar for tabs */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Marquee wrapper */
.marquee-wrapper {
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 2rem;
    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);
    padding: 1rem 0;
}

.marquee-content {
    display: flex;
    flex-shrink: 0;
    justify-content: space-around;
    min-width: 100%;
    gap: 3rem;
    align-items: center;
}

.marquee-content-reverse {
    animation-direction: reverse;
}

/* Reference Logos */
.marquee-content img {
    height: 60px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    filter: grayscale(0%) opacity(90%);
    transition: all 0.3s ease;
}

.marquee-content img:hover {
    filter: grayscale(0%) opacity(100%);
    transform: scale(1.05);
}

/* Bento Grid Hover Effects */
.bento-card {
    transition: all 0.3s ease;
}
.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Active Tab Style */
.tab-btn.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-left: 4px solid #2563eb;
    font-weight: 600;
}
.tab-btn {
    border-left: 4px solid transparent;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Floating Animation for Hero Image */
@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.animate-floating {
    animation: floating 6s ease-in-out infinite;
}

/* Hero Section - Modern Enhancements */
@keyframes pulse-slow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.animate-pulse-slow {
    animation: pulse-slow 8s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.animate-glow {
    animation: glow 4s ease-in-out infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient {
    background-size: 200% auto;
    animation: gradient-shift 4s ease infinite;
}

/* Hero Floating Orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-orb-1 {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    top: 20%;
    right: 15%;
    animation: float-orb 12s ease-in-out infinite;
}

.hero-orb-2 {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
    bottom: 25%;
    left: 10%;
    animation: float-orb 10s ease-in-out infinite 2s;
}

.hero-orb-3 {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: 60%;
    right: 25%;
    animation: float-orb 14s ease-in-out infinite 1s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    33% { transform: translate(15px, -20px) scale(1.1); opacity: 1; }
    66% { transform: translate(-10px, 15px) scale(0.95); opacity: 0.7; }
}

/* Bootstrap-compatible language dropdown (toggle via .show on .header-lang-dropdown; shell-ui.js) */
.header-lang-dropdown .dropdown-menu {
    display: none;
    min-width: 11rem;
    padding: 0.35rem 0;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
    z-index: 60;
}
.header-lang-dropdown.show .dropdown-menu {
    display: block;
}
.header-lang-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(51 65 85);
    text-decoration: none;
    white-space: nowrap;
}
.header-lang-dropdown .dropdown-item:hover {
    background: rgb(248 250 252);
    color: rgb(29 78 216);
}
.header-lang-dropdown .flag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.625rem;
    height: 1.125rem;
    overflow: hidden;
    border-radius: 0.125rem;
    border: 1px solid rgb(226 232 240 / 0.9);
}
.dilRenk {
    color: inherit;
}

/* Site shell: prevent horizontal overflow on narrow viewports */
html, body {
    max-width: 100%;
    overflow-x: clip;
}

#navbar {
    overflow-x: clip;
}

/* Header: hamburger until wide enough for full nav — avoids clipped links before mobile menu */
.header-nav-desktop,
.header-actions-desktop {
    display: none !important;
}

.header-mobile-toggle {
    display: flex !important;
}

@media (min-width: 1536px) {
    .header-nav-desktop {
        display: flex !important;
    }

    .header-actions-desktop {
        display: flex !important;
    }

    .header-mobile-toggle {
        display: none !important;
    }
}

/* 4NDrive: extra CTA needs more horizontal space */
@media (min-width: 1536px) and (max-width: 1679px) {
    html[data-site-brand="fourndrive"] .header-nav-desktop,
    html[data-site-brand="fourndrive"] .header-actions-desktop {
        display: none !important;
    }

    html[data-site-brand="fourndrive"] .header-mobile-toggle {
        display: flex !important;
    }
}

@media (min-width: 1680px) {
    html[data-site-brand="fourndrive"] .header-nav-desktop {
        display: flex !important;
    }

    html[data-site-brand="fourndrive"] .header-actions-desktop {
        display: flex !important;
    }

    html[data-site-brand="fourndrive"] .header-mobile-toggle {
        display: none !important;
    }
}

.hero-section {
    overflow-x: clip;
}

.hero-section > .absolute.blur-3xl {
    max-width: 100vw;
}

/* Mobile menu: allow long DE/RU labels to wrap */
@media (max-width: 1679px) {
    #mobile-menu .header-lang-dropdown .dropdown-item {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}