/* Shared brand sheet for every Fleet web surface (www apex, webauthd portal,
   media-gateway gate and player chrome). No webfont payload, no swap; each
   platform renders its native reading faces. Serif prose vs sans chrome keeps
   the content/control distinction. Measured on Firefox 156/Linux in the DOM
   cascade (2026-10-01): ui-sans-serif and ui-monospace alone resolve to the
   serif face, so chrome leads with system-ui; times entries in the prose stack
   poisoned ui-serif's resolution (a Times-metric face instead of the platform
   serif), so prose is ui-serif, georgia, serif; <code> rides the UA monospace
   rule. The class and token inventory is a closed contract with
   crates/site-chrome and crates/media-gateway:
   skip-link, site-header, site-nav, brand, site-main, prose,
   auth-panel, auth-input, auth-button, auth-status,
   site-footer, footer-contact, footer-legal.
   The border token is decorative only (1.3:1 on bg): never the sole boundary
   or state cue — state rides the accent outline, fill, text, or marks. */
:root {
    --bg: #ffffff;
    --bg-subtle: #f4f4f4;
    --text: #1a1a1a;
    --text-muted: #5a5a5a;
    --border: #e2e2e2;
    --link: #1a4f8a;
    --link-hover: #0f3d6f;
    --accent: #1a4f8a;

    --font-prose: ui-serif, georgia, serif;
    --font-chrome: system-ui, ui-sans-serif, sans-serif;

    --step--1: 0.8rem;
    --step-0: 1.0rem;
    --step-1: 1.25rem;
    --step-2: 1.5625rem;
    --step-3: 1.953rem;

    --measure: 42rem;
    --measure-wide: 64rem;
    --pad-x: 1.25rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0d0d;
        --bg-subtle: #161616;
        --text: #e8e8e8;
        --text-muted: #9a9a9a;
        --border: #262626;
        --link: #7ab4ec;
        --link-hover: #a8caf2;
        --accent: #7ab4ec;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(0.9rem, 0.85rem + 0.4vw, 1.1rem);
    background-color: var(--bg);
    color: var(--text);
    min-width: 20rem;
}

body {
    font-family: var(--font-prose);
    font-size: var(--step-0);
    line-height: 1.6;
}

/* Skip link: first focusable element; visually hidden until focused. */
.skip-link {
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
}

.skip-link:focus {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    clip: auto;
    height: auto;
    width: auto;
    margin: 0;
    padding: 0.5rem 1rem;
    background: var(--bg);
    color: var(--link);
    border: 1px solid var(--border);
    z-index: 100;
}

/* Header: full-bleed chrome band; nav constrained to the wide measure. */
.site-header {
    font-family: var(--font-chrome);
    border-bottom: 1px solid var(--border);
}

.site-nav {
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 1.5rem var(--pad-x);
}

/* Brand: a non-apex surface leads its nav with the service name; the apex
   nav's Home link is its own brand. */
.site-nav .brand {
    font-weight: bold;
    color: var(--accent);
    margin-right: 1.25rem;
}

.site-nav a {
    font-size: var(--step--1);
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 1.25rem;
    transition: color 0.2s;
}

.site-nav a:last-child {
    margin-right: 0;
}

.site-nav a:hover {
    color: var(--link-hover);
}

/* Main shell: wide container; prose narrows to reading measure inside it. */
.site-main {
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 2rem var(--pad-x);
}

/* Auth surface: the webauthd ceremony pages (register, login) and the portal
   sign-out. A measure-constrained panel and an AA-contrast accent button
   (--bg text on --accent). */
.auth-panel {
    max-width: var(--measure);
    margin: 2rem auto;
}

.auth-input {
    font-family: var(--font-chrome);
    font-size: var(--step-0);
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
}

.auth-button {
    font-family: var(--font-chrome);
    font-size: var(--step-0);
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-button:hover {
    background: var(--link-hover);
}

/* Status line: min-height reserves one line so the panel does not jump when a
   ceremony message appears. */
.auth-status {
    font-family: var(--font-chrome);
    color: var(--text-muted);
    min-height: 1.6em;
    margin-top: 1rem;
}

/* Prose: every authored body; reading measure, tag-level styling. */
.prose {
    max-width: var(--measure);
    margin: 0 auto;
}

.prose h1,
.prose h2 {
    font-weight: bold;
    line-height: 1.25;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.prose h1 {
    font-size: var(--step-3);
    margin-top: 0;
}

.prose h2 {
    font-size: var(--step-2);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.prose p {
    margin-bottom: 1rem;
}

/* Links: body links read as text first; underline appears on hover/active. */
a {
    color: var(--link);
    text-decoration: none;
}

a:visited {
    color: var(--link);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Footer: full-bleed entity band; content constrained to the wide measure. */
.site-footer {
    font-family: var(--font-chrome);
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: var(--step--1);
}

.footer-contact,
.footer-legal {
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 0 var(--pad-x);
    text-align: center;
}

.footer-contact {
    padding-top: 2.5rem;
    margin-bottom: 0.25rem;
}

.footer-contact a {
    margin: 0 0.5rem;
}

.footer-legal {
    padding-bottom: 2rem;
}

/* Accessibility floor. */
[href]:focus-visible,
.auth-input:focus-visible,
.auth-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .site-nav a,
    .auth-button {
        transition: none;
    }
}
