@layer reset, page, shell;

@layer reset {
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
        min-height: 100vh;
        margin: 0;
        display: flex;
        flex-direction: column;
        background: var(--shell-paper);
    }
    a { color: inherit; }
    .page-canvas {
        flex: 1;
        min-height: 100vh;
    }
}

@layer shell {
    .site-header {
        --header-surface-opacity: 1;
        --header-backdrop-blur: .75rem;
        --header-backdrop-saturation: .8;
        position: fixed;
        z-index: 100;
        top: 1rem;
        right: max(1rem, env(safe-area-inset-right));
        left: max(1rem, env(safe-area-inset-left));
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: min(calc(100% - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)), 1240px);
        margin-inline: auto;
        min-height: 5.75rem;
        padding: .3rem 1.75rem;
        background: rgb(var(--identity-light-rgb) / var(--header-surface-opacity));
        color: var(--shell-ink);
        border: 1px solid rgb(24 33 29 / calc(var(--header-surface-opacity) * .1));
        border-radius: 1rem;
        box-shadow: 0 1.25rem 3rem rgb(24 33 29 / calc(var(--header-surface-opacity) * .12));
        backdrop-filter: blur(var(--header-backdrop-blur)) saturate(var(--header-backdrop-saturation));
        transition: color .3s ease;
        will-change: background-color, border-color, box-shadow, color;
        -webkit-backdrop-filter: blur(var(--header-backdrop-blur)) saturate(var(--header-backdrop-saturation));
    }

    .site-brand {
        display: inline-flex;
        align-items: center;
        color: inherit;
        font-size: 1.6rem;
        font-weight: 700;
        line-height: 1;
        text-decoration: none;
    }

    .site-header .site-brand { font-size: clamp(2.8rem, 4vw, 3.25rem); }

    .page-home .site-header {
        --header-surface-opacity: 0;
        --header-backdrop-blur: 0rem;
        --header-backdrop-saturation: 1;
        --header-brand-progress: 0;
        --header-brand-offset: -.45rem;
        color: #fff;
    }

    .page-home .site-header.is-header-solid {
        color: var(--shell-ink);
    }

    .page-home .site-header .site-brand {
        opacity: var(--header-brand-progress);
        transform: translateY(var(--header-brand-offset));
    }

    .page-home .site-header.is-brand-hidden .site-brand {
        pointer-events: none;
    }

    .page-home .site-header .site-brand .brand-wordmark::before {
        animation: none;
    }

    .page-home .site-header.is-brand-entering .site-brand .brand-wordmark::after {
        animation: brand-gradient-flow 5.2s linear both;
    }

    .site-navigation {
        display: flex;
        align-items: center;
        gap: 1.75rem;
    }

    .site-navigation a {
        color: inherit;
        font-size: .9rem;
        font-weight: 650;
        text-decoration: none;
    }

    .site-navigation a:hover,
    .site-navigation a:focus-visible { color: var(--shell-accent); }

    .site-navigation .site-access {
        min-height: 2.5rem;
        padding: .5rem .9rem;
        display: inline-flex;
        align-items: center;
        border: 1px solid currentColor;
    }


    .site-footer {
        width: min(calc(100% - 2rem), 1240px);
        margin: 0 auto;
        padding: 2rem 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
        background: var(--shell-paper);
        color: var(--shell-ink);
        border-top: 1px solid rgb(24 33 29 / .12);
    }

    .site-footer small { color: var(--shell-muted); }

    @media (max-width: 720px), (orientation: landscape) and (max-height: 600px) {
        .site-header {
            top: .75rem;
            right: max(.75rem, env(safe-area-inset-right));
            left: max(.75rem, env(safe-area-inset-left));
            width: calc(100% - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right));
            min-height: 4.75rem;
            gap: .5rem;
            padding: .3rem .75rem;
            border-radius: .8rem;
        }

        .site-header .site-brand {
            flex: none;
            font-size: 2rem;
        }

        .site-navigation {
            min-width: 0;
            gap: .5rem;
        }

        .site-navigation .site-access {
            display: none;
        }

        .language-switcher { flex: none; }
        .site-navigation > a:not(.site-access) { display: none; }

        .site-footer {
            width: calc(100% - 1.5rem);
            padding: 1.5rem 0;
            gap: 1rem;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .site-header { transition: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.language-switcher { display: inline-flex; margin: 0; align-items: center; }
.language-switcher button { border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: .75rem; padding: .25rem .42rem; cursor: pointer; }
.language-switcher button:first-of-type { border-radius: 999px 0 0 999px; }
.language-switcher button:last-of-type { margin-left: -1px; border-radius: 0 999px 999px 0; }
.language-switcher button[aria-current="true"] { border-color: var(--shell-ink); background: var(--shell-ink); color: #fff; box-shadow: none; cursor: default; }
.page-home .site-header:not(.is-header-solid) .language-switcher button[aria-current="true"] { border-color: #fff; background: #fff; color: var(--shell-ink); }
