/* assets/styles/front/11-home-header.css */

.codex-header {
    position: sticky;
    z-index: 100;
    top: 0;
    border-bottom: 1px solid rgb(66 245 230 / 15%);
    background: rgb(8 5 20 / 92%);
    color: #f7f4ff;
    backdrop-filter: blur(18px);
}

.codex-header::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    width: 32%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        #f23bd2
    );
    content: "";
}

.codex-header__inner {
    position: relative;
    display: flex;
    width: min(100% - 2rem, 1920px);
    min-height: 70px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.codex-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.65rem;
    color: #f7f4ff;
    font-family:
        "Barlow Condensed",
        Impact,
        sans-serif;
    font-size: 1.45rem;
    font-style: italic;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-decoration: none;
}

.codex-brand:hover {
    color: #f7f4ff;
}

.codex-brand__mark {
    display: grid;
    width: 34px;
    height: 34px;
    border: 1px solid rgb(244 201 93 / 65%);
    border-radius: 50%;
    color: #f4c95d;
    font-size: 1.4rem;
    place-items: center;
    box-shadow: 0 0 22px rgb(244 201 93 / 22%);
}

.codex-brand__name {
    line-height: 1;
}

.codex-navigation {
    position: static;
}

.codex-navigation__control {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.codex-navigation__toggle {
    display: grid;
    width: 44px;
    height: 44px;
    cursor: pointer;
    place-content: center;
    gap: 7px;
}

.codex-navigation__toggle > span:not(.sr-only) {
    display: block;
    width: 23px;
    height: 2px;
    background: #f7f4ff;
    transition:
        transform 160ms ease,
        opacity 160ms ease;
}

.codex-navigation__control:checked
    + .codex-navigation__toggle
    > span:first-child {
    transform: translateY(4.5px) rotate(45deg);
}

.codex-navigation__control:checked
    + .codex-navigation__toggle
    > span:nth-child(2) {
    transform: translateY(-4.5px) rotate(-45deg);
}

.codex-navigation__links {
    position: absolute;
    top: 100%;
    right: -1rem;
    left: -1rem;
    display: none;
    padding: 0.65rem 1rem 1rem;
    border-bottom: 1px solid rgb(66 245 230 / 18%);
    background: rgb(8 5 20 / 98%);
    box-shadow: 0 1.25rem 2.5rem rgb(0 0 0 / 35%);
}

.codex-navigation__control:checked
    ~ .codex-navigation__links {
    display: grid;
}

.codex-navigation__link {
    position: relative;
    display: flex;
    min-height: 48px;
    padding: 0.85rem 0.25rem;
    align-items: center;
    color: #a79dbf;
    font-size: 0.93rem;
    font-weight: 500;
    text-decoration: none;
}

.codex-navigation__link:hover,
.codex-navigation__link:focus-visible,
.codex-navigation__link.is-active {
    color: #f7f4ff;
}

.codex-navigation__link::after {
    position: absolute;
    right: 0.25rem;
    bottom: 0.45rem;
    left: 0.25rem;
    height: 2px;
    background: #42f5e6;
    content: "";
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
}

.codex-navigation__link:hover::after,
.codex-navigation__link:focus-visible::after,
.codex-navigation__link.is-active::after {
    transform: scaleX(1);
}

.codex-brand:focus-visible,
.codex-navigation__control:focus-visible
    + .codex-navigation__toggle,
.codex-navigation__link:focus-visible {
    outline: 2px solid #42f5e6;
    outline-offset: 4px;
}

/* Language switcher */

.codex-language {
    position: relative;
    width: 100%;
    border-top: 1px solid rgb(167 157 191 / 14%);
}

.codex-language__summary {
    display: flex;
    min-height: 48px;
    padding: 0.7rem 0.25rem;
    cursor: pointer;
    list-style: none;
    align-items: center;
    gap: 0.65rem;
    color: #a79dbf;
}

.codex-language__summary::-webkit-details-marker {
    display: none;
}

.codex-language__summary:hover,
.codex-language__summary:focus-visible {
    color: #f7f4ff;
}

.codex-language__summary:focus-visible {
    outline: 2px solid #42f5e6;
    outline-offset: 4px;
}

.codex-language__flag {
    flex: 0 0 auto;
    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        sans-serif;
    font-size: 1.25rem;
    line-height: 1;
}

.codex-language__mobile-label {
    flex: 1;
    font-size: 0.93rem;
    font-weight: 500;
}

.codex-language__chevron {
    color: #42f5e6;
    font-size: 1rem;
    line-height: 1;
    transition: transform 160ms ease;
}

.codex-language[open] .codex-language__chevron {
    transform: rotate(180deg);
}

.codex-language__options {
    display: grid;
    gap: 0.2rem;
    margin: 0 0 0.5rem;
    padding: 0.4rem;
    border: 1px solid rgb(66 245 230 / 18%);
    background: #120a26;
    list-style: none;
}

.codex-language__options li {
    margin: 0;
    padding: 0;
}

.codex-language__option {
    display: grid;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    grid-template-columns: 1.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    color: #a79dbf;
    font-size: 0.86rem;
    text-decoration: none;
}

a.codex-language__option:hover,
a.codex-language__option:focus-visible {
    background: rgb(66 245 230 / 8%);
    color: #f7f4ff;
}

a.codex-language__option:focus-visible {
    outline: 2px solid #42f5e6;
    outline-offset: -2px;
}

.codex-language__option.is-current {
    background: rgb(66 245 230 / 6%);
    color: #f7f4ff;
}

.codex-language__check {
    color: #42f5e6;
    font-weight: 700;
}

@media (min-width: 48rem) {
    .codex-header__inner {
        min-height: 78px;
    }

    .codex-navigation__control,
    .codex-navigation__toggle {
        display: none;
    }

    .codex-navigation__links,
    .codex-navigation__control:checked
        ~ .codex-navigation__links {
        position: static;
        display: flex;
        padding: 0;
        align-items: center;
        gap: clamp(1rem, 2.5vw, 2.5rem);
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .codex-navigation__link {
        min-height: 78px;
        padding: 0.25rem 0;
    }

    .codex-navigation__link::after {
        right: 0;
        bottom: 0;
        left: 0;
    }

    .codex-language {
        width: auto;
        border-top: 0;
    }

    .codex-language__summary {
        width: 48px;
        min-height: 48px;
        padding: 0;
        justify-content: center;
        border: 1px solid transparent;
        border-radius: 50%;
    }

    .codex-language__summary:hover,
    .codex-language[open] .codex-language__summary {
        border-color: rgb(66 245 230 / 24%);
        background: rgb(66 245 230 / 7%);
    }

    .codex-language__mobile-label {
        display: none;
    }

    .codex-language__chevron {
        position: absolute;
        right: 1px;
        bottom: 4px;
        font-size: 0.7rem;
    }

    .codex-language__options {
        position: absolute;
        z-index: 120;
        top: calc(100% + 0.65rem);
        right: 0;
        width: max-content;
        min-width: 11.5rem;
        margin: 0;
        padding: 0.45rem;
        border-color: rgb(66 245 230 / 25%);
        box-shadow: 0 1.25rem 2.75rem rgb(0 0 0 / 45%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .codex-navigation__toggle > span:not(.sr-only),
    .codex-navigation__link::after,
    .codex-language__chevron {
        transition: none;
    }
}