/*
 * Shared page chrome for every page except index.html (which keeps its own
 * HUD layout in styles.css): colour tokens, skip link, header with logo and
 * language switch, and the footer with the legal links.
 *
 * Tokens are prefixed with --pw- so they cannot collide with the --primary /
 * --secondary variables the older pages define inline with other values.
 */

:root {
    --pw-bg: #0F0F1E;
    --pw-grid: #1A1A2E;
    --pw-panel: #1C1C1C;
    --pw-panel-raised: #242424;
    --pw-text: #F8F8F8;
    --pw-text-muted: #B8B8B8;
    --pw-line: rgba(248, 248, 248, 0.14);
    --pw-red: #D62828;
    --pw-blue: #0066CC;
    --pw-blue-light: #66B2FF;
    --pw-orange: #FF9500;
    --pw-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pw-font-pixel: "Press Start 2P", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --pw-gutter: 16px;
}

/* --- Skip link: invisible until it receives keyboard focus --- */
.pw-skip {
    position: absolute;
    left: var(--pw-gutter);
    top: -100px;
    z-index: 1000;
    padding: 0.6rem 1rem;
    background: var(--pw-orange);
    color: #1C1C1C;
    font-family: var(--pw-font-sans);
    font-weight: 700;
    text-decoration: none;
    border-radius: 2px;
}

.pw-skip:focus {
    top: 0.75rem;
}

/* --- Header --- */
.pw-header {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem var(--pw-gutter);
    font-family: var(--pw-font-sans);
}

.pw-logo {
    font-family: var(--pw-font-pixel);
    font-size: clamp(0.95rem, 3.6vw, 1.25rem);
    line-height: 1.2;
    letter-spacing: -1px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--pw-orange);
    padding: 0.35rem 0;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .pw-logo {
        background: linear-gradient(135deg, var(--pw-red), var(--pw-blue-light), var(--pw-orange));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

@media (forced-colors: active) {
    .pw-logo {
        -webkit-text-fill-color: LinkText;
        background: none;
    }
}

.pw-lang {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pw-lang a {
    display: inline-block;
    min-width: 2.75rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(248, 248, 248, 0.25);
    background: rgba(248, 248, 248, 0.05);
    color: var(--pw-text);
    font-family: var(--pw-font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pw-lang a:hover {
    border-color: var(--pw-blue-light);
}

.pw-lang a[aria-current="page"] {
    background: var(--pw-blue);
    border-color: var(--pw-blue);
    color: #FFFFFF;
}

/* --- Footer --- */
.pw-footer {
    box-sizing: border-box;
    width: 100%;
    margin-top: 3rem;
    padding: 1.25rem var(--pw-gutter) 2rem;
    background: rgba(28, 28, 28, 0.95);
    border-top: 1px solid var(--pw-line);
    color: var(--pw-text-muted);
    font-family: var(--pw-font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
}

.pw-footer p {
    margin: 0 0 0.5rem;
}

.pw-footer ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pw-footer li {
    margin: 0;
}

.pw-footer a {
    display: inline-block;
    padding: 0.3rem 0.4rem;
    color: var(--pw-blue-light);
    text-decoration: none;
}

.pw-footer a:hover {
    color: var(--pw-orange);
    text-decoration: underline;
}

.pw-footer a[aria-current="page"] {
    color: var(--pw-text);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.pw-skip:focus-visible,
.pw-logo:focus-visible,
.pw-lang a:focus-visible,
.pw-footer a:focus-visible {
    outline: 2px solid var(--pw-orange);
    outline-offset: 2px;
}

@media print {
    .pw-skip,
    .pw-lang,
    .pw-footer {
        display: none;
    }

    .pw-logo {
        -webkit-text-fill-color: #000000;
        color: #000000;
        background: none;
    }
}
