
/* ==========================================================
   CYBER HOUSE 360 - COMPLETE HEADER CSS
   Floating Glass Navigation + Premium Services Mega Menu

   1. Global header spacing
   2. Floating glass pill
   3. Company logo
   4. Desktop navigation
   5. Animated glider
   6. Services mega menu
   7. Quote button
   8. Scrolled header
   9. Light header theme
   10. Mobile navigation
   11. Responsive adjustments
   12. Accessibility
   ========================================================== */


/* ==========================================================
   1. GLOBAL HEADER SPACING
   ========================================================== */

:root {
    --header-space: 94px;
    --hero-gap: 80px;

    --ch-purple: #9b4dff;
    --ch-purple-light: #c7a3ff;
    --ch-navy: #0a0f2c;
    --ch-text: #b9bedd;

    --ch-gradient: linear-gradient(
        135deg,
        #9b4dff,
        #4930f5
    );
}

main > section:first-child {
    padding-top: calc(
        var(--header-space) + var(--hero-gap)
    );
}

.site-header + .flash-area {
    padding-top: var(--header-space);
}


/* ==========================================================
   2. FLOATING GLASS HEADER
   ========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;
    height: var(--header-space);

    margin-bottom: calc(var(--header-space) * -1);
    padding: 14px 0;

    background: transparent;

    transition: padding 0.35s ease;
}

.header-shell {
    width: 100%;
    max-width: var(--max-width, 1440px);

    margin: 0 auto;
    padding: 0 clamp(20px, 3vw, 48px);
}

.header-pill {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    height: 66px;
    padding: 0 10px 0 24px;

    border-radius: 100px;

    background: rgba(255, 255, 255, 0.045);

    border: 1px solid rgba(255, 255, 255, 0.09);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);

    transition:
        height 0.35s ease,
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.header-pill::after {
    content: "";

    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -1px;

    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(155, 77, 255, 0.8),
        rgba(26, 15, 208, 0.6),
        transparent
    );

    pointer-events: none;
}


/* ==========================================================
   3. COMPANY LOGO
   ========================================================== */

.header-logo {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;

    flex: 0 0 auto;

    text-decoration: none;
}

.header-logo img {
    display: block;

    width: auto;
    height: 40px;
    max-width: 100%;

    object-fit: contain;

    transition: height 0.35s ease;
}

.header-logo .logo-on-light {
    display: none;
}


/* ==========================================================
   4. DESKTOP NAVIGATION
   ========================================================== */

.main-nav {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 4px;

    flex: 0 1 auto;

    margin: 0 auto;
    padding: 5px;

    border-radius: 100px;

    background: rgba(255, 255, 255, 0.035);
}

.main-nav > .nav-top-link,
.main-nav .nav-dropdown-trigger > .nav-top-link {
    position: relative;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 9px 16px;

    border-radius: 100px;

    color: var(--ch-text);

    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;

    white-space: nowrap;
    text-decoration: none;

    transition: color 0.25s ease;
}

.main-nav .nav-top-link:hover,
.main-nav .nav-top-link.active {
    color: #ffffff;
}

.main-nav .nav-top-link.active::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 3px;

    width: 4px;
    height: 4px;

    margin-left: -2px;

    border-radius: 50%;

    background: var(--ch-purple);

    box-shadow: 0 0 8px var(--ch-purple);
}


/* ==========================================================
   5. ANIMATED NAVIGATION GLIDER
   ========================================================== */

.nav-glider {
    position: absolute;

    top: 5px;
    left: 0;
    z-index: 0;

    width: 0;
    height: 36px;

    border-radius: 100px;

    background: rgba(155, 77, 255, 0.16);

    border: 1px solid rgba(155, 77, 255, 0.35);

    opacity: 0;

    pointer-events: none;

    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease;
}

.nav-glider.show {
    opacity: 1;
}


/* ==========================================================
   6. SERVICES DROPDOWN
   ========================================================== */

.nav-dropdown {
    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
}

.nav-dropdown-trigger {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 36px;

    border-radius: 100px;
}

.main-nav .nav-services-link {
    padding-right: 4px;
}

.nav-dropdown-toggle {
    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 26px;
    height: 36px;

    margin-right: 7px;
    padding: 0;

    border: none;
    border-radius: 50%;

    background: transparent;

    color: var(--ch-text);

    cursor: pointer;

    transition: color 0.25s ease;
}

.nav-dropdown-toggle svg {
    display: block;

    transition: transform 0.3s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
    color: var(--ch-purple-light);
}

.nav-dropdown.open .nav-dropdown-toggle svg {
    transform: rotate(180deg);
}


/* ==========================================================
   7. PREMIUM MEGA MENU
   ========================================================== */

.services-mega-menu {
    position: absolute;

    top: calc(100% + 20px);
    left: 50%;
    z-index: 500;

    width: min(720px, calc(100vw - 48px));

    padding: 26px;

    border-radius: 24px;

    background: rgba(12, 18, 45, 0.98);

    border: 1px solid rgba(155, 77, 255, 0.28);

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45),
        0 0 45px rgba(155, 77, 255, 0.08);

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    opacity: 0;
    visibility: hidden;

    transform: translate(-50%, -10px);

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.3s ease,
        visibility 0.25s ease;
}

/* Keeps the dropdown open while moving the mouse */

.services-mega-menu::before {
    content: "";

    position: absolute;

    top: -22px;
    left: 0;
    right: 0;

    height: 22px;
}

.nav-dropdown.open .services-mega-menu {
    opacity: 1;
    visibility: visible;

    transform: translate(-50%, 0);

    pointer-events: auto;
}


/* MEGA MENU HEADING */

.mega-menu-heading {
    padding: 0 4px 20px;
    margin-bottom: 18px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mega-eyebrow {
    display: block;

    margin-bottom: 8px;

    color: #b68cff;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 2px;
}

.mega-menu-heading h3 {
    margin: 0 0 8px;

    color: #ffffff;

    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.mega-menu-heading p {
    margin: 0;

    color: #aeb8d4;

    font-size: 13px;
    line-height: 1.6;
}


/* TWO-COLUMN SERVICE GRID */

.mega-menu-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.main-nav .mega-service {
    position: relative;

    display: flex;
    align-items: flex-start;

    gap: 13px;

    min-width: 0;

    padding: 14px;

    border-radius: 14px;
    border: 1px solid transparent;

    background: transparent;

    color: #ffffff;

    text-decoration: none;

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.main-nav .mega-service:hover,
.main-nav .mega-service:focus-visible {
    background: rgba(155, 77, 255, 0.1);

    border-color: rgba(155, 77, 255, 0.3);

    transform: translateY(-2px);
}


/* SERVICE ICONS */

.mega-service-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: rgba(155, 77, 255, 0.09);

    border: 1px solid rgba(155, 77, 255, 0.25);

    color: #b68cff;

    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.mega-service-icon svg {
    display: block;

    width: 21px;
    height: 21px;
}

.mega-service:hover .mega-service-icon {
    background: rgba(155, 77, 255, 0.2);

    border-color: rgba(155, 77, 255, 0.5);
}


/* SERVICE TEXT */

.mega-service-content {
    display: flex;
    flex-direction: column;

    min-width: 0;
    gap: 7px;
}

.main-nav .mega-service-content strong,
.site-header.on-light .main-nav .mega-service-content strong {
    color: #ffffff;

    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
}

.main-nav .mega-service-content small,
.site-header.on-light .main-nav .mega-service-content small {
    color: #aeb8d4;

    font-size: 11px;
    font-weight: 400;
    line-height: 1.6;
}


/* MEGA MENU FOOTER */

.mega-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 18px;
    padding: 18px 4px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mega-menu-footer > span {
    color: #aeb8d4;
    font-size: 12px;
}

.main-nav .mega-menu-footer a,
.site-header.on-light .main-nav .mega-menu-footer a {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding: 0;

    color: #c7a3ff;

    font-size: 12px;
    font-weight: 650;

    text-decoration: none;
    white-space: nowrap;
}

.main-nav .mega-menu-footer a:hover {
    color: #ffffff;
}


/* ==========================================================
   8. QUOTE BUTTON
   ========================================================== */

.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    gap: 10px;

    height: 46px;
    padding: 0 22px;

    border-radius: 100px;

    background: var(--gradient, var(--ch-gradient));

    color: #ffffff;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;
    white-space: nowrap;

    box-shadow: 0 8px 24px rgba(155, 77, 255, 0.35);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.nav-cta:hover {
    transform: translateY(-2px);

    box-shadow: 0 12px 30px rgba(155, 77, 255, 0.5);
}

.cta-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #38e5a0;

    animation: ctaPulse 2.2s infinite;
}

@keyframes ctaPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 229, 160, 0.6);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(56, 229, 160, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 229, 160, 0);
    }
}

.nav-cta-mobile {
    display: none;
}


/* ==========================================================
   9. SCROLLED HEADER
   ========================================================== */

.site-header.scrolled {
    padding: 10px 0;
}

.site-header.scrolled .header-pill {
    height: 60px;

    background: rgba(10, 15, 44, 0.86);

    border-color: rgba(155, 77, 255, 0.28);

    box-shadow:
        0 18px 45px rgba(10, 15, 44, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header.scrolled .header-logo img {
    height: 36px;
}


/* ==========================================================
   10. LIGHT HEADER THEME
   ========================================================== */

.site-header.on-light .header-pill {
    background: rgba(255, 255, 255, 0.85);

    border-color: rgba(17, 24, 62, 0.1);

    box-shadow:
        0 18px 45px rgba(10, 15, 44, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.site-header.on-light .header-logo .logo-on-dark {
    display: none;
}

.site-header.on-light .header-logo .logo-on-light {
    display: block;
}

.site-header.on-light .main-nav {
    background: rgba(17, 24, 62, 0.045);
}

.site-header.on-light .main-nav .nav-top-link {
    color: #5a6284;
}

.site-header.on-light .main-nav .nav-top-link:hover,
.site-header.on-light .main-nav .nav-top-link.active {
    color: #0a0f2c;
}

.site-header.on-light .nav-dropdown-toggle {
    color: #5a6284;
}

.site-header.on-light .nav-dropdown-toggle:hover {
    color: #7833ff;
}

.site-header.on-light .nav-glider {
    background: rgba(155, 77, 255, 0.12);

    border-color: rgba(155, 77, 255, 0.3);
}

/* Mega menu always stays dark */

.site-header.on-light .services-mega-menu {
    background: rgba(12, 18, 45, 0.98);
}

.site-header.on-light .mega-menu-heading h3 {
    color: #ffffff;
}

.site-header.on-light .main-nav .mega-service {
    color: #ffffff;
}


/* ==========================================================
   11. MOBILE TOGGLE
   ========================================================== */

.nav-toggle {
    position: relative;

    display: none;

    flex: 0 0 auto;

    width: 46px;
    height: 46px;

    margin-left: auto;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);

    cursor: pointer;
}

.nav-toggle span {
    position: absolute;
    left: 14px;

    width: 18px;
    height: 2px;

    border-radius: 2px;

    background: #ffffff;

    transition:
        transform 0.3s ease,
        top 0.3s ease;
}

.nav-toggle span:nth-child(1) {
    top: 18px;
}

.nav-toggle span:nth-child(2) {
    top: 25px;
}

.nav-toggle.open span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    top: 21px;
    transform: rotate(-45deg);
}

.site-header.on-light .nav-toggle {
    background: rgba(17, 24, 62, 0.04);

    border-color: rgba(17, 24, 62, 0.12);
}

.site-header.on-light .nav-toggle span {
    background: #0a0f2c;
}


/* ==========================================================
   12. TABLET AND MOBILE
   ========================================================== */

@media (max-width: 860px) {

    :root {
        --header-space: 80px;
        --hero-gap: 48px;
    }

    .site-header {
        padding: 10px 0;
    }

    .header-pill {
        height: 60px;

        gap: 12px;
        padding: 0 7px 0 18px;
    }

    .header-logo img,
    .site-header.scrolled .header-logo img {
        height: 34px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-cta-desktop,
    .nav-glider {
        display: none;
    }

    /* MOBILE NAVIGATION CARD */

    .main-nav {
        position: absolute;

        top: calc(100% + 10px);
        left: 0;
        right: 0;

        z-index: 100;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 2px;

        max-height: calc(100dvh - 110px);

        margin: 0;
        padding: 10px;

        border-radius: 22px;

        background: #0c1233;

        border: 1px solid rgba(155, 77, 255, 0.28);

        box-shadow: 0 24px 50px rgba(10, 15, 44, 0.35);

        overflow-x: hidden;
        overflow-y: auto;

        opacity: 0;
        visibility: hidden;

        transform: translateY(-8px) scale(0.98);
        transform-origin: top center;

        pointer-events: none;

        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0.25s ease;
    }

    .main-nav.open {
        opacity: 1;
        visibility: visible;

        transform: translateY(0) scale(1);

        pointer-events: auto;
    }

    .site-header.on-light .main-nav {
        background: #0c1233;
    }

    .main-nav > .nav-top-link,
    .main-nav .nav-dropdown-trigger > .nav-top-link,
    .site-header.on-light .main-nav .nav-top-link {
        justify-content: flex-start;

        min-height: 48px;

        padding: 14px 16px;

        border-radius: 14px;

        color: #b9bedd;

        font-size: 15px;
    }

    .main-nav .nav-top-link:hover,
    .main-nav .nav-top-link.active,
    .site-header.on-light .main-nav .nav-top-link:hover,
    .site-header.on-light .main-nav .nav-top-link.active {
        background: rgba(155, 77, 255, 0.14);
        color: #ffffff;
    }

    .main-nav .nav-top-link.active::after {
        left: auto;
        right: 18px;
        top: 50%;
        bottom: auto;

        margin: -2px 0 0;
    }

    /* MOBILE SERVICES ACCORDION */

    .nav-dropdown {
        display: block;
        width: 100%;
    }

    .nav-dropdown-trigger {
        display: flex;
        width: 100%;
    }

    .main-nav .nav-services-link {
        flex: 1;
    }

    .nav-dropdown-toggle {
        width: 48px;
        height: 48px;

        margin: 0 5px 0 0;

        border-radius: 12px;

        background: rgba(155, 77, 255, 0.08);

        color: #c7a3ff;
    }

    .services-mega-menu {
        position: static;

        width: 100%;
        max-height: 0;

        margin: 0;
        padding: 0;

        border: none;
        border-radius: 14px;

        background: rgba(155, 77, 255, 0.055);

        box-shadow: none;

        backdrop-filter: none;
        -webkit-backdrop-filter: none;

        overflow: hidden;

        opacity: 0;
        visibility: hidden;

        transform: none;

        pointer-events: none;

        transition:
            max-height 0.35s ease,
            opacity 0.25s ease,
            padding 0.25s ease;
    }

    .services-mega-menu::before {
        display: none;
    }

    .nav-dropdown.open .services-mega-menu {
        max-height: 1000px;

        margin-top: 6px;
        padding: 16px 10px;

        opacity: 1;
        visibility: visible;

        transform: none;

        pointer-events: auto;
    }

    .mega-menu-heading {
        padding: 0 10px 14px;
        margin-bottom: 10px;
    }

    .mega-menu-heading h3 {
        font-size: 17px;
    }

    .mega-menu-heading p {
        font-size: 12px;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .main-nav .mega-service {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .mega-service-icon {
        flex-basis: 38px;

        width: 38px;
        height: 38px;
    }

    .mega-service-icon svg {
        width: 19px;
        height: 19px;
    }

    .mega-menu-footer {
        flex-direction: column;
        align-items: flex-start;

        padding: 15px 10px 0;
        margin-top: 12px;
    }

    /* MOBILE QUOTE BUTTON */

    .main-nav .nav-cta-mobile {
        display: flex;

        height: 50px;

        margin-top: 8px;

        color: #ffffff;

        background: var(--gradient, var(--ch-gradient));
    }
}


/* ==========================================================
   13. SMALL SCREENS
   ========================================================== */

@media (max-width: 480px) {

    .header-shell {
        padding: 0 14px;
    }

    .header-pill {
        padding-left: 14px;
    }

    .header-logo img,
    .site-header.scrolled .header-logo img {
        height: 30px;
    }

    .mega-menu-heading p {
        font-size: 11px;
    }

    .main-nav .mega-service-content strong {
        font-size: 12px;
    }

    .main-nav .mega-service-content small {
        font-size: 10px;
    }
}


/* ==========================================================
   14. ACCESSIBILITY
   ========================================================== */

.main-nav a:focus-visible,
.nav-dropdown-toggle:focus-visible,
.nav-cta:focus-visible,
.nav-toggle:focus-visible {
    outline: 2px solid var(--ch-purple);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    .site-header,
    .header-pill,
    .header-logo img,
    .nav-glider,
    .main-nav,
    .services-mega-menu,
    .mega-service,
    .mega-service-icon,
    .nav-dropdown-toggle svg {
        transition: none !important;
    }

    .cta-dot {
        animation: none !important;
    }
}
