/* Shared stylesheet for the public marketing trio (landing / login / 404) --
   design tokens, reset, and the masthead/nav system. Page-specific layout (hero, proof
   mocks, login card, etc.) stays in each page's own <style> block. */

:root {
    --bg: #0d1117;
    --panel: #161b22;
    --panel-alt: #1c2128;
    --border: #30363d;
    --border-dim: #21262d;
    --header-bg: #21262d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    /* #848d97 on #0d1117 measures 5.62:1 (WCAG relative-luminance formula, computed directly --
       not eyeballed), comfortably clearing AA's 4.5:1 floor for small text. The old #484f58
       measured 2.28:1 -- well under threshold. --text/--text-dim unchanged. */
    --text-faint: #848d97;
    --blue: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --serif: 'Fraunces', Georgia, serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    /* Masthead's rendered height (main bar + dossier sub-bar + its double-rule border) --
       every scroll offset derives from this one value so they can't drift apart. The mobile
       nav panel is an absolutely-positioned overlay (see below), not part of document flow,
       so this stays constant across breakpoints -- nothing to redefine in the 860px query. */
    --header-h: 91px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ---- Anchor scrolling: always clear the sticky header by --header-h + a bit of air ---- */
html { scroll-padding-top: calc(var(--header-h) + 16px); }
section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ---- Accessibility: focus ring + skip link ---- */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.skip-link {
    position: absolute; top: -100px; left: 8px; z-index: 100;
    background: var(--blue); color: #0d1117; font-weight: 600; font-size: 0.82rem;
    padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---- Masthead ---- */
.masthead {
    border-bottom: 4px double var(--border);
    position: sticky; top: 0; z-index: 10;
    background: rgba(13,17,23,0.94);
    backdrop-filter: blur(8px);
}
.masthead-bar {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; position: relative;
}
.brand {
    font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit;
}
.brand .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

#site-nav { display: flex; align-items: center; gap: 28px; }
#site-nav a.nav-link {
    color: var(--text-dim); font-size: 0.875rem; letter-spacing: 0.02em;
    text-decoration: none; padding: 14px 0; transition: color 0.15s, border-color 0.15s;
    border-bottom: 2px solid transparent;
}
#site-nav a.nav-link:hover,
#site-nav a.nav-link:focus-visible { color: var(--text); text-decoration: underline; }
#site-nav a.nav-link[aria-current="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.login-btn {
    border: 1px solid var(--border); padding: 7px 16px; font-size: 0.76rem;
    letter-spacing: 0.04em; color: var(--text); transition: border-color 0.15s, color 0.15s;
    text-transform: uppercase; text-decoration: none;
}
.login-btn:hover, .login-btn:focus-visible { border-color: var(--blue); color: var(--blue); text-decoration: underline; }

.nav-toggle {
    display: none; background: none; border: 1px solid var(--border); color: var(--text);
    width: 40px; height: 40px; align-items: center; justify-content: center;
    cursor: pointer; flex-direction: column; gap: 4px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); }

.masthead-sub { border-top: 1px solid var(--border-dim); }
.masthead-sub .wrap { display: flex; align-items: center; justify-content: space-between; height: 30px; }
.dossier-tag { font-size: 0.62rem; color: var(--text-faint); letter-spacing: 0.15em; text-transform: uppercase; }
.chain-badges { display: flex; gap: 6px; }
.chain-badge {
    font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
    border: 1px solid var(--border-dim); padding: 2px 8px;
}

/* ---- Any panel-like box: never let its content force page-level horizontal scroll ---- */
.panel table, table { max-width: 100%; }

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    #site-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--panel); border-bottom: 1px solid var(--border);
        padding: 4px 32px 12px;
    }
    #site-nav[hidden] { display: none; }
    #site-nav a.nav-link {
        padding: 13px 0; border-bottom: 1px solid var(--border-dim);
        min-height: 44px; display: flex; align-items: center;
    }
    #site-nav .login-btn { margin-top: 10px; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .masthead-sub .dossier-tag { display: none; }
    .panel { overflow-x: auto; }
}
@media (min-width: 861px) {
    /* The `hidden` attribute is what JS toggles for the mobile disclosure panel -- at desktop
       widths the nav must always be visible regardless of that state (e.g. a viewer closes the
       mobile menu then widens the window without a reload). */
    #site-nav[hidden] { display: flex; }
}
