/* Header & Footer Styles - Shared across all pages
   ============================================= */

/* ==========================================
   FULL-WIDTH DARK BAR HEADER  (Reference style)
   ========================================== */
/* Prevent any horizontal overflow site-wide */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 60px;
    display: flex;
    align-items: center;
    background: #0d0e12;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.4s ease,
        border-color 0.4s ease;
    /* NOTE: will-change: transform intentionally omitted — it creates a new
       CSS containing block which clips any position:fixed children (the mobile nav)
       to the header's own height instead of the viewport. */
}

/* scroll-hide disabled — header is always sticky */

/* Slightly more opaque when scrolled */
header.scrolled {
    background: rgba(10, 11, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* At top — clean dark */
header.at-top {
    background: #0d0e12;
    border-color: rgba(255, 255, 255, 0.06);
}

/* Inner layout */
.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* --- Logo ---------------------------------------------------------- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 120px;
}

.logo-icon {
    width: 110px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* --- Nav Capsule --------------------------------------------------- */
nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-capsule {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.nav-tab svg {
    opacity: 0.6;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.nav-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.07);
}

.nav-tab:hover svg {
    opacity: 0.8;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-tab.active svg {
    opacity: 1;
}

/* --- Header Actions ------------------------------------------------ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 120px;
    justify-content: flex-end;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: border-color 0.25s ease,
        background 0.25s ease,
        color 0.25s ease;
}

.cta-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* --- User Dropdown ------------------------------------------------- */
.user-dropdown {
    position: relative;
}

.header-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding: 7px 14px 7px 10px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 13.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
    font-family: inherit;
}

.header-user-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chevron-icon {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.header-user-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.user-dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 210px;
    background: rgba(18, 18, 24, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 300;
}

.user-dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-dropdown-content a {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 10px 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.2s;
}

.user-dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff !important;
}

.user-dropdown-content a i {
    width: 16px;
    text-align: center;
    opacity: 0.65;
}

.user-dropdown-content .logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5 !important;
}

.user-dropdown-content .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 4px 8px;
}

/* --- Animated hamburger --------------------------------------------- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    display: block;
    width: 18px;
    height: 1.5px;
    margin: 0 auto;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease;
    transform-origin: center;
}

.mobile-menu-btn.is-open .hamburger-line:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.mobile-menu-btn.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.is-open .hamburger-line:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

body.nav-lock {
    overflow: hidden;
}


/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background: #07070B;
    color: #f1f1f3;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 72px 48px 40px;
    box-sizing: border-box;
}

/* --- Footer Top: Brand + CTA --- */
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
    margin-bottom: 56px;
}

.footer-brand-block {
    max-width: 380px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 18px;
}

.footer-logo span {
    font-size: 22px;
    font-weight: 700;
    color: #f1f1f3;
    letter-spacing: -0.3px;
}

.footer-logo:hover span {
    color: #A78BFA;
}

.footer-tagline {
    font-size: 14.5px;
    line-height: 1.7;
    color: #71717a;
    margin: 0 0 24px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    transition: all 0.25s ease;
}

.footer-social-link:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
    color: #A78BFA;
    transform: translateY(-2px);
}

.footer-cta-block {
    text-align: right;
    flex-shrink: 0;
}

.footer-cta-text {
    font-size: 14px;
    color: #71717a;
    margin: 0 0 12px;
}

.footer-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #8B5CF6;
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.footer-cta-btn:hover {
    background: #7C3AED;
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.35);
    transform: translateY(-2px);
}

.footer-cta-btn svg {
    transition: transform 0.25s ease;
}

.footer-cta-btn:hover svg {
    transform: translateX(3px);
}

/* --- Footer Links Grid --- */
.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding: 48px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d4d4d8;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    font-size: 14.5px;
    color: #71717a;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.5;
}

.footer-col ul li a:hover {
    color: #A78BFA;
}

/* --- Footer Bottom --- */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
}

.footer-copy {
    font-size: 13px;
    color: #52525b;
    margin: 0;
}

.footer-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #52525b;
}

.footer-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #3f3f46;
}

/* Legacy footer backward compat */
footer:not(.site-footer) {
    background: #07070B;
    color: #f1f1f3;
    padding: 80px 40px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer:not(.site-footer) .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto 40px;
}

footer h3,
footer h4 {
    color: #f1f1f3 !important;
}

footer p {
    color: #a1a1aa !important;
}

footer:not(.site-footer) .footer-col h4 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0;
    text-transform: none;
    color: #f1f1f3 !important;
}

footer:not(.site-footer) .footer-col p {
    font-size: 15px;
    color: #a1a1aa !important;
    line-height: 1.6;
    margin: 0;
}

footer:not(.site-footer) .footer-brand {
    max-width: 280px;
}

footer:not(.site-footer) .footer-brand h3 {
    font-size: 19px;
    font-weight: 600;
    color: #f1f1f3 !important;
    margin-bottom: 24px;
    letter-spacing: 0;
}

footer:not(.site-footer) .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer:not(.site-footer) .footer-col ul li {
    margin-bottom: 10px;
    font-size: 15px;
    color: #a1a1aa !important;
    padding: 4px 0;
    line-height: 1.6;
}

footer:not(.site-footer) .footer-col ul li a {
    color: #a1a1aa !important;
    text-decoration: none;
    transition: color 0.2s;
}

footer:not(.site-footer) .footer-col ul li a:hover {
    color: #8B5CF6 !important;
}

footer:not(.site-footer) .footer-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 40px auto 20px;
    max-width: 1200px;
}

footer:not(.site-footer) .footer-copyright {
    text-align: center;
    font-size: 15px;
    color: #52525b !important;
    max-width: 1200px;
    margin: 0 auto;
}


/* Close button inside mobile nav — hidden everywhere by default;
   only shown by the @media (max-width: 768px) + nav.nav-open rule */
.nav-close-btn {
    display: none !important;
}


/* ==========================================
   TABLET / NARROW DESKTOP  (769px – 1050px)
   Shrink nav tabs so they all fit
   ========================================== */
@media (max-width: 1050px) {
    .header-inner {
        gap: 10px;
    }

    .nav-tab {
        padding: 6px 10px;
        font-size: 12.5px;
        gap: 0;
        /* hide gap from icon */
    }

    /* Hide icons at this width to save space */
    .nav-tab svg {
        display: none;
    }

    .nav-capsule {
        gap: 0;
        padding: 3px;
    }

    .cta-btn {
        padding: 7px 14px;
        font-size: 12.5px;
    }
}

/* ==========================================
   SWITCH TO HAMBURGER  (769px – 900px)
   Nav capsule is too cramped — use mobile menu
   ========================================== */
@media (max-width: 900px) {

    /* Hide the desktop nav capsule */
    nav#main-nav {
        display: none !important;
    }

    /* Show the hamburger button */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Apply same mobile nav overlay styles as ≤768px */
    nav#main-nav.nav-open {
        display: flex !important;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        height: 100vh;
        z-index: 10000;
        flex-direction: column;
        background: #080910;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
        overflow-y: auto;
        overflow-x: hidden;
    }
}


/* ==========================================
   MOBILE  (<= 768px)
   ========================================== */
@media (max-width: 768px) {
    header {
        height: 52px;
        /* Always on top — above the mobile nav overlay */
        z-index: 10001;
        overflow: hidden;
        /* prevent any child from creating horizontal overflow */
    }

    .header-inner {
        padding: 0 12px;
        gap: 4px;
        overflow: hidden;
    }

    .logo-icon {
        width: 82px;
        height: 30px;
    }

    /* ═══════════════════════════════════════
       FULL-SCREEN MOBILE NAV — slide from right
       header stays on top (z-index: 10001) so
       hamburger is always tappable
       ═══════════════════════════════════════ */
    nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        /* Use dvh for reliable full viewport height on mobile browsers */
        height: 100dvh;
        height: 100vh;
        /* fallback */
        z-index: 10000;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0;
        /* Fully opaque — no bleed-through ever */
        background: #080910;
        /* Hidden: slide off to the right */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(100%);
        transition: opacity 0.3s ease,
            visibility 0.3s ease,
            transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
        flex: unset;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    nav.nav-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
    }

    .nav-capsule {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        gap: 0;
        /* Space below the fixed header bar (52px) */
        padding-top: 52px;
    }

    /* Purple/blue accent bar — visual divider below header */
    .nav-capsule::after {
        content: '';
        display: block;
        height: 2px;
        background: linear-gradient(90deg, #8B5CF6, #3b82f6 60%, transparent);
        margin: 0 20px 20px;
        border-radius: 2px;
    }

    .nav-tab {
        font-size: 17px;
        font-weight: 600;
        letter-spacing: -0.3px;
        padding: 15px 24px;
        border-radius: 0;
        color: rgba(255, 255, 255, 0.52);
        width: 100%;
        justify-content: flex-start;
        gap: 14px;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: color 0.18s ease, background 0.18s ease, padding-left 0.22s ease;
        min-height: 54px;
    }

    .nav-tab:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-tab svg {
        display: inline-flex;
        opacity: 0.4;
        flex-shrink: 0;
        width: 17px;
        height: 17px;
        transition: opacity 0.18s ease;
    }

    .nav-tab:hover {
        background: rgba(139, 92, 246, 0.07);
        color: rgba(255, 255, 255, 0.9);
        padding-left: 32px;
        border-color: rgba(139, 92, 246, 0.12);
    }

    .nav-tab:hover svg {
        opacity: 0.85;
    }

    .nav-tab.active {
        background: rgba(139, 92, 246, 0.09);
        color: #c4b5fd;
        border-left: 3px solid #8B5CF6;
        padding-left: 21px;
        box-shadow: none;
    }

    .nav-tab.active svg {
        opacity: 1;
        color: #a78bfa;
    }

    /* ── In-sidebar close (×) button ── */
    .nav-close-btn {
        display: none;
        /* hidden on desktop */
        position: absolute;
        top: 10px;
        right: 14px;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 50%;
        color: rgba(255, 255, 255, 0.75);
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        z-index: 1;
        flex-shrink: 0;
    }

    .nav-close-btn:hover {
        background: rgba(139, 92, 246, 0.2);
        border-color: rgba(139, 92, 246, 0.45);
        color: #fff;
    }

    nav.nav-open .nav-close-btn {
        display: flex !important;
    }

    /* Hamburger is always visible above the nav overlay */
    .mobile-menu-btn {
        display: flex;
        position: relative;
        flex-shrink: 0;
    }

    /* When nav is open: make the X button stand out with a brighter border */
    .mobile-menu-btn.is-open {
        background: rgba(139, 92, 246, 0.18);
        border-color: rgba(139, 92, 246, 0.4);
    }

    /* Glow separator below header when nav is open */
    header:has(+ * .nav-open),
    body.nav-lock header {
        border-bottom-color: rgba(139, 92, 246, 0.35);
        box-shadow: 0 1px 0 rgba(139, 92, 246, 0.2);
    }

    .cta-btn {
        padding: 6px 13px;
        font-size: 12.5px;
        letter-spacing: 0;
    }

    /* Footer */
    .footer-inner {
        padding: 48px 20px 32px;
    }

    .footer-top {
        flex-direction: column;
        gap: 32px;
    }

    .footer-cta-block {
        text-align: left;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px 24px;
        padding: 36px 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-badge {
        justify-content: center;
    }
}

/* Tablet tweaks */
@media (min-width: 769px) and (max-width: 1080px) {
    .header-inner {
        padding: 0 20px;
    }

    .nav-tab {
        font-size: 12.5px;
        padding: 6px 11px;
    }

    .footer-inner {
        padding: 56px 36px 36px;
    }

    .footer-top {
        gap: 32px;
    }

    .footer-links {
        gap: 28px;
    }
}

/* Extra-small footer tweak */
@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}