/* Technology Global User (TGU) - header: skip link, logo, menu, mega menu, dropdowns, AI popup, burger and mobile menu.
   Every class is prefixed tgu-header__ (BEM). */

/* ---------- Header bar ---------- */
.tgu-header {
    position: sticky;
    top: env(safe-area-inset-top,0px);
    z-index: 100;
    background: color-mix(in srgb,var(--bg) 90%,transparent);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .3s, background-color .3s;
}

/* Sticky state: a little more breathing room and a soft shadow instead of a cramped bar */
.tgu-header.tgu-is-scrolled {
    background: color-mix(in srgb,var(--bg) 94%,transparent);
    border-bottom-color: transparent;
    box-shadow: 0 1px 0 #0b1f3a0f, 0 12px 32px #0b1f3a14;
}

/* ---------- Layout ---------- */
.tgu-header__container {
    max-width: 1248px;
    margin: 0 auto;
    padding: 0 32px;
}

.tgu-header__nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    height: 80px;
    transition: height .3s;
}

.tgu-header.tgu-is-scrolled .tgu-header__nav {
    height: 72px;
}

/* ---------- Logo ---------- */
.tgu-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    margin-right: auto;
    white-space: nowrap;
}

/* ---------- Menu ---------- */
.tgu-header__menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.tgu-header__item {
    height: 100%;
    display: flex;
    align-items: center;
}

.tgu-header__item--relative {
    position: relative;
}

.tgu-header__link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px;
    height: 100%;
    font-size: 15px;
    font-weight: 700;
    transition: color .2s;
}

.tgu-header__link svg {
    transition: transform .25s;
}

.tgu-header__link:hover,
.tgu-is-open>.tgu-header__link {
    color: var(--brand);
}

.tgu-is-open>.tgu-header__link svg {
    transform: rotate(180deg);
}

.tgu-skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 300;
    padding: 12px 20px;
    border-radius: 12px;
    background: #0B1F3A;
    color: #fff;
    font-weight: 700;
}

.tgu-skip-link:focus {
    left: 8px;
}

/* ---------- Mega menu ---------- */
.tgu-header__mega,
.tgu-header__dropdown {
    position: absolute;
    top: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 32px 64px #0B1F3A2b;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .22s,transform .22s,visibility .22s;
}

.tgu-header__mega {
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(1040px,94vw);
    display: grid;
    grid-template-columns: 290px 1fr;
}

.tgu-header__mega::before,
.tgu-header__dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -16px;
    height: 16px;
}

.tgu-is-open>.tgu-header__mega,
.tgu-is-open>.tgu-header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.tgu-header__mega-rail {
    background: var(--soft);
    padding: 20px;
    display: grid;
    gap: 8px;
    align-content: start;
    border-radius: 24px 0 0 24px;
}

.tgu-header__mega-tab {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 0;
    border-radius: 16px;
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: .2s;
}

.tgu-header__mega b {
    display: block;
    font-size: 15px;
    line-height: 1.3;
}

.tgu-header__mega small {
    display: block;
    color: var(--mut);
    font-size: 12.5px;
    line-height: 1.4;
}

.tgu-header__mega-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--card);
    color: var(--brand);
    display: grid;
    place-items: center;
    flex: none;
}

.tgu-header__mega-tab.tgu-is-active {
    background: var(--card);
    box-shadow: 0 8px 24px #0B1F3A14;
}

.tgu-header__mega-tab.tgu-is-active .tgu-header__mega-icon {
    background: var(--brand);
    color: #fff;
}

.tgu-header__mega-panes {
    padding: 28px 32px 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tgu-header__mega-pane {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.tgu-header__mega-pane.tgu-is-active {
    display: grid;
    animation: tguFade .25s ease;
}

.tgu-header__mega-heading {
    display: none;
}

.tgu-header__mega-link {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
}

.tgu-header__mega-link:hover {
    background: var(--soft);
}

.tgu-header__mega-link .tgu-header__mega-icon {
    background: var(--soft);
}

.tgu-header__mega-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: auto -32px 0;
    padding: 18px 32px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--mut);
}

.tgu-header__mega-footer a {
    color: var(--brand);
    font-weight: 700;
}

/* ---------- Dropdown ---------- */
.tgu-header__dropdown {
    left: 0;
    min-width: 240px;
    padding: 8px;
}

.tgu-header__dropdown a {
    display: block;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14.5px;
}

.tgu-header__dropdown a:hover {
    background: var(--soft);
    color: var(--brand);
}

/* ---------- Header call to action ---------- */
.tgu-header__menu-cta {
    display: none;
}

.tgu-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--brand);
    transition: .2s;
    white-space: nowrap;
}

.tgu-header__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px #2F80FF44;
}

.tgu-header__cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 7px 7px 26px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg,#1F6FEB 0%,#2F80FF 50%,#6FB1FF 100%);
    background-size: 170% 100%;
    background-position: 0 0;
    color: #fff;
    font: 700 15px var(--f);
    box-shadow: 0 12px 28px #2F80FF55,inset 0 1px 0 #ffffff66;
    transition: transform .3s cubic-bezier(.2,.8,.2,1),box-shadow .3s,background-position .5s;
    cursor: pointer;
}

.tgu-header__cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg,transparent 35%,#ffffff66 50%,transparent 65%);
    transform: translateX(-130%);
    transition: transform .7s;
}

.tgu-header__cta::after {
    content: "";
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F6FEB' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/18px no-repeat;
    transform: rotate(-45deg);
    transition: transform .4s cubic-bezier(.2,.8,.2,1);
}

.tgu-header__cta:hover {
    transform: translateY(-3px);
    background-position: 100% 0;
    box-shadow: 0 18px 36px #2F80FF66,inset 0 1px 0 #ffffff66;
}

.tgu-header__cta:hover::before {
    transform: translateX(130%);
}

.tgu-header__cta:hover::after {
    transform: rotate(0) scale(1.08);
}

.tgu-header__cta {
    padding: 5px 5px 5px 20px;
    font-size: 14px;
}

.tgu-header__cta::after {
    width: 32px;
    height: 32px;
    background-size: 16px;
}

.tgu-header__menu-cta .tgu-header__cta {
    width: 100%;
}

/* ---------- Burger button ---------- */
.tgu-header__burger {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    cursor: pointer;
    margin-left: 8px;
    flex: none;
}

.tgu-header__burger span {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: .3s;
}

.tgu-header__burger span:nth-child(1) {
    top: 15px;
}

.tgu-header__burger span:nth-child(2) {
    top: 21px;
}

.tgu-header__burger span:nth-child(3) {
    top: 27px;
}

.tgu-is-open .tgu-header__burger span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

.tgu-is-open .tgu-header__burger span:nth-child(2) {
    opacity: 0;
}

.tgu-is-open .tgu-header__burger span:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}

.tgu-header__logo-img {
    display: block;
    width: 250px;
    height: auto;
}

/* ---------- Animations ---------- */
@keyframes tguFade {
    from {
        opacity: 0;
    }
}

/* ---------- Responsive ---------- */
@media(hover:hover) and (min-width:961px) {
    .tgu-header__item--has-panel:hover>.tgu-header__mega,
    .tgu-header__item--has-panel:hover>.tgu-header__dropdown {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

@media(max-width:960px) {
    .tgu-header__burger,
    .tgu-header__item.tgu-is-expanded>.tgu-header__mega,
    .tgu-header__item.tgu-is-expanded>.tgu-header__dropdown {
        display: block;
    }

    .tgu-header__cta--desktop,
    .tgu-header__mega::before,
    .tgu-header__dropdown::before,
    .tgu-header__mega-rail,
    .tgu-header__mega-footer {
        display: none;
    }

    .tgu-header {
        backdrop-filter: none;
        background: var(--bg);
    }

    .tgu-header__container {
        padding: 0 20px;
    }

    .tgu-header__nav {
        height: 68px;
    }

    .tgu-header.tgu-is-scrolled .tgu-header__nav {
        height: 64px;
    }

    .tgu-header__menu {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: auto;
        max-height: calc(100vh - var(--tgu-header-height,64px));
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg);
        padding: 8px 20px 28px;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 40px #0B1F3A1f;
    }

    .tgu-header.tgu-is-open .tgu-header__menu {
        display: flex;
    }

    .tgu-header__item {
        display: block;
        height: auto;
        border-bottom: 1px solid var(--line);
    }

    .tgu-header__link {
        height: auto;
        padding: 18px 4px;
        font-size: 17px;
        justify-content: space-between;
    }

    .tgu-header__mega,
    .tgu-header__dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: auto;
        margin: 0 0 12px;
        box-shadow: none;
        border: 0;
        background: none;
        border-radius: 0;
        padding: 0;
    }

    .tgu-header__item.tgu-is-expanded>.tgu-header__link {
        color: var(--brand);
    }

    .tgu-header__item.tgu-is-expanded>.tgu-header__link svg {
        transform: rotate(180deg);
    }

    .tgu-header__mega-panes {
        padding: 0;
    }

    .tgu-header__mega-pane {
        display: grid;
        grid-template-columns: 1fr;
        animation: none;
    }

    .tgu-header__mega-heading {
        display: block;
        margin: 12px 4px 4px;
        font-size: 12px;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--mut);
    }

    .tgu-header__menu-cta {
        display: block;
        padding-top: 20px;
    }

    .tgu-header__menu-cta .tgu-header__cta {
        display: flex;
        width: 100%;
    }
}

@media (max-width: 960px) {
    .tgu-header__cta--desktop {
        display: none;
    }
}

@media (max-width: 960px) {
    .tgu-header__burger {
        margin-left: 8px;
    }
}

@media (max-width: 480px) {
    .tgu-header__logo-img {
        width: 190px;
    }
}

@media (min-width: 1400px) {
    .tgu-header__container {
        max-width: 1320px;
    }
}

/* ---------- Layout: logo left, menu centre, actions right ---------- */
.tgu-header__logo {
    margin-right: 0;
    justify-self: start;
}

.tgu-header__menu {
    justify-self: center;
}

.tgu-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ---------- AI popup (one icon, four assistants) ---------- */
.tgu-header__ai {
    position: relative;
}

.tgu-header__ai-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--brand);
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.tgu-header__ai-button:hover,
.tgu-header__ai.tgu-is-open .tgu-header__ai-button {
    border-color: var(--brand);
    box-shadow: 0 8px 22px #2f80ff33;
    transform: translateY(-2px);
}

.tgu-header__ai-button svg {
    width: 22px;
    height: 22px;
}

.tgu-header__ai-panel {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 110;
    width: 320px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 24px 48px #0b1f3a29;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.tgu-header__ai.tgu-is-open .tgu-header__ai-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.tgu-header__ai-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 800;
}

.tgu-header__ai-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tgu-header__ai-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 4px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.tgu-header__ai-list a:hover {
    background: var(--soft);
}

.tgu-header__ai-list img {
    display: block;
    width: 46px;
    height: 46px;
    transition: transform 0.25s ease;
}

.tgu-header__ai-list a:hover img {
    transform: translateY(-3px);
}

@media (max-width: 1100px) {
    .tgu-header__logo-img {
        width: 210px;
    }

    .tgu-header__link {
        padding: 0 10px;
    }
}

@media (max-width: 960px) {
    .tgu-header__nav {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    /* The panel anchors to the header so it never runs off the screen. */
    .tgu-header__ai {
        position: static;
    }

    .tgu-header__ai-panel {
        top: calc(100% + 8px);
        right: 20px;
        width: min(320px, calc(100vw - 40px));
    }
}
