*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

html[data-pending-i18n] body {
    visibility: hidden;
}

body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 4px;
}

::selection {
    background: rgba(241, 227, 176, 0.28);
    color: var(--text);
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 0;
    z-index: 100;
    transform: translateY(-140%);
    background: var(--gold);
    color: var(--bg);
    padding: 0.65rem 0.9rem;
    text-decoration: none;
    letter-spacing: 0.08em;
}

.skip-link:focus {
    transform: none;
}

main:focus {
    outline: none;
}

.veil {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: var(--bg);
    pointer-events: none;
    animation: veilOut 0.85s ease 0.05s forwards;
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("../images/grain.svg");
    background-size: 180px 180px;
    mix-blend-mode: overlay;
}

.shell {
    width: min(var(--shell), calc(100% - 2.5rem));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "brand lang"
        "nav nav";
    gap: 0.7rem 1rem;
    align-items: center;
    padding: calc(0.8rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) 0.85rem calc(1rem + env(safe-area-inset-left));
    background: rgba(11, 11, 12, 0.78);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(241, 227, 176, 0.12);
}

.wordmark {
    grid-area: brand;
    justify-self: start;
    max-width: 11.5rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--gold);
}

.tm {
    letter-spacing: 0;
    font-size: 0.55em;
    line-height: 0;
    vertical-align: super;
}

.wordmark:hover {
    color: var(--text);
}

.site-nav {
    grid-area: nav;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
}

.site-nav__link {
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    white-space: nowrap;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
    color: var(--gold);
}

.site-nav__link[aria-current="page"] {
    box-shadow: inset 0 -1px 0 var(--gold);
}

.lang {
    grid-area: lang;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.lang__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-faint);
    padding: 0.45rem 0.28rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1;
}

.lang__btn.is-active,
.lang__btn[aria-pressed="true"] {
    color: var(--gold);
}

.site-footer {
    border-top: 1px solid rgba(241, 227, 176, 0.12);
    padding: 1.5rem 0 calc(1.6rem + env(safe-area-inset-bottom));
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.5rem;
    align-items: end;
    justify-content: space-between;
}

.site-footer__brand,
.site-footer__place {
    margin: 0;
}

.site-footer__brand {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.site-footer__place {
    margin-top: 0.3rem;
    color: var(--text-faint);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.site-footer__nav {
    display: flex;
    gap: 1rem;
}

.site-footer__nav a {
    color: var(--text-faint);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-footer__nav a:hover,
.site-footer__nav a[aria-current="page"] {
    color: var(--gold);
}

.button {
    appearance: none;
    justify-self: start;
    border: 1px solid rgba(241, 227, 176, 0.55);
    background: transparent;
    color: var(--gold);
    padding: 0.95rem 1.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.button:hover {
    background: var(--gold);
    color: var(--bg);
}

@keyframes veilOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sheen {
    from { transform: translateX(-120%); }
    to { transform: translateX(120%); }
}

@keyframes mistDrift {
    from { transform: translate3d(-3%, 0, 0) scale(1); }
    to { transform: translate3d(4%, -3%, 0) scale(1.08); }
}

@keyframes beamSpin {
    to { --beam-angle: 360deg; }
}

@media (min-width: 768px) {
    .wordmark {
        max-width: 13.5rem;
        font-size: 0.84rem;
        letter-spacing: 0.12em;
    }

    .shell {
        width: min(var(--shell), calc(100% - 3.5rem));
    }
}

@media (min-width: 1024px) {
    .site-header {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "brand nav lang";
        padding-inline: 2rem;
    }

    .site-nav {
        justify-content: center;
    }
}

@media (min-width: 1440px) {
    :root {
        --shell: 1200px;
    }
}

@media (min-width: 1920px) {
    :root {
        --shell: 1280px;
    }

    .shell {
        width: min(var(--shell), calc(100% - 8rem));
    }
}
