/* The height the fixed header occupies: 8px padding + the .line-container
   title (1.25px border + 2px padding + 4px logo offset + 26px logo + 2px
   padding) + 8px padding. Anything sticky below has to clear it, so it is
   read from here as --header-height rather than re-measured per page. */
:root {
    --header-height: 3.125rem;
}

.header {
    position: fixed;
    padding: 8px;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    background-color: white;
}

.header-title {
    grid-column: 1;
}

.header.is-nav-open {
    height: 100dvh;
    background-color: white;
    grid-template-rows: auto 1fr;
}

.header-actions {
    text-transform: uppercase;
}

.header-logo {
    display: block;
    width: fit-content;
}

.header-logo-reveal {
    display: block;
    position: relative;
    height: 26px;
    margin-top: 4px;
}

.header-logo-reveal svg {
    display: block;
    width: auto;
    height: 26px;
    overflow: visible;
}

.header-logo-reveal .logo-x-leg {
    transform: translateX(14.31px);
}

/* Header: Mobile Toggle + Nav */
.header-menu,
.header-actions {
    display: none;
}

.header-representation-type {
    grid-column: 3/5;
}

.header.is-nav-open .header-representation-type {
    display: none;
}

.header-toggle {
    grid-column: -2/-1;
    grid-row: 1;
    justify-self: end;
    width: 28px;
    height: 28px;
    background-color: white;
}

.header-toggle-icon,
.header-toggle-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.header-toggle-icon-close {
    display: none;
    padding: 7px;
    rotate: 45deg;
}

.header.is-nav-open .header-toggle-icon-open {
    display: none;
}

.header.is-nav-open .header-toggle-icon-close {
    display: block;
}

.header-mobile-nav {
    display: none;
    grid-column: 1/-1;
    grid-row: 2;
}

.header.is-nav-open .header-mobile-nav {
    display: grid;
    grid-template-rows: 1fr auto;
    overflow-y: auto;
}

.header-mobile-nav-list {
    display: grid;
    gap: 1.5rem 0;
    padding: 3rem 0;
}

.header-mobile-nav-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
}

.header-mobile-nav-languages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media screen and (min-width: 1024px) {
    .header {
        grid-template-columns: repeat(24, 1fr);
    }

    .header-menu {
        grid-column: 7/19;
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 8px;
    }

    .header-actions {
        grid-column: -4/-1;
        display: flex;
        justify-content: flex-end;
        gap: 4px;
    }

    .header-representation-type {
        grid-column: 3/5;
        grid-row: 1;
        width: 100%;
        display: flex;
    }

    .header-toggle {
        display: none;
    }
}

/*
    Header: Splash Sequence
*/
body[data-splash-stage]:not([data-splash-stage="reveal"]) .header-menu,
body[data-splash-stage]:not([data-splash-stage="reveal"]) .header-actions,
body[data-splash-stage]:not([data-splash-stage="reveal"]) .header-toggle {
    display: none;
}

body[data-splash-stage="logo"] .header-title {
    border-top-color: transparent;
}

/* Splash: Logo Stage */
body[data-splash-stage="logo"] .header-logo-reveal {
    overflow: hidden;
    width: 0;
}

body[data-splash-stage="logo"] .header-logo-reveal .logo-x-leg {
    transform: translateX(0);
}

body[data-splash-stage="logo"] .header-logo-reveal[data-logo-step="a"] {
    width: 22.79px;
}

body[data-splash-stage="logo"] .header-logo-reveal[data-logo-step="ar"] {
    width: 46.55px;
}

body[data-splash-stage="logo"] .header-logo-reveal[data-logo-step="arx"] {
    width: 69.15px;
}

body[data-splash-stage="logo"] .header-logo-reveal[data-logo-step="final"] {
    width: 76.53px;
    transition: width 250ms ease;
}

body[data-splash-stage="logo"] .header-logo-reveal[data-logo-step="final"] .logo-x-leg {
    transform: translateX(14.31px);
    transition: transform 250ms ease;
}

body[data-splash-stage="logo"] .header-representation-type {
    display: none;
}
