/* ---- Base / Reset ------------------------------------------------------- */
:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --text: #0a0a0a;
    --muted-text: #555;
    --border: rgba(0, 0, 0, .12);
    --ink-soft: rgba(0, 0, 0, .06);
    --link: #0b63f6;
    --link-visited: #6a38c2;
    --card: #fff;
    --pill-bg: rgba(0, 0, 0, .06);
    --notice-info-bg: #eef5ff;
    --notice-info-border: #cfe1ff;
    --notice-warn-bg: #fff6e6;
    --notice-warn-border: #ffe0a6;
    --notice-ok-bg: #ecfbf0;
    --notice-ok-border: #c9f1d5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0c0c;
        --text: #fafafa;
        --muted-text: #bdbdbd;
        --border: rgba(255, 255, 255, .16);
        --ink-soft: rgba(255, 255, 255, .06);
        --card: #121212;
        --pill-bg: rgba(255, 255, 255, .08);
        --notice-info-bg: #0d1b2a;
        --notice-info-border: #1e3a5f;
        --notice-warn-bg: #2a1e0a;
        --notice-warn-border: #5a3c12;
        --notice-ok-bg: #0f2415;
        --notice-ok-border: #1d4d2a;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    scroll-behavior: smooth;
    line-height: 1.5;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
}

/* ---- Brand Header ------------------------------------------------------- */
.brand-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.brand-header img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.brand-header a {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.brand-header a:hover {
    color: var(--link);
    text-decoration: underline;
}

/* ---- Layout ------------------------------------------------------------- */
.container {
    max-width: 840px;
    margin: 2rem auto;
    padding: 0 1rem;
}

header.page-head {
    margin-bottom: 1.25rem;
}

.header-sub {
    color: var(--muted-text);
    margin: .25rem 0 0;
    font-size: .95rem;
}

.pill {
    display: inline-block;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: var(--pill-bg);
    font-size: .85rem;
}

/* ---- Typography ---------------------------------------------------------- */
h1,
h2,
h3 {
    line-height: 1.25;
    margin: 1.25rem 0 .5rem;
}

h1 {
    font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem);
}

h2 {
    font-size: clamp(1.25rem, 1.2vw + .9rem, 1.5rem);
}

h3 {
    font-size: 1.1rem;
}

p,
ul,
ol {
    margin: .8rem 0;
}

ul,
ol {
    padding-left: 1.25rem;
}

small,
.muted {
    color: var(--muted-text);
}

/* ---- Links --------------------------------------------------------------- */
a {
    color: var(--link);
    text-decoration: none;
}

a:visited {
    color: var(--link-visited);
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* ---- Cards / Sections ---------------------------------------------------- */
.section {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    background: var(--card);
    margin: 1rem 0;
}

.section h2:first-child {
    margin-top: 0;
}

/* ---- Notices ------------------------------------------------------------- */
.notice {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .8rem .9rem;
    margin: 1rem 0;
    background: var(--ink-soft);
}

.notice.info {
    background: var(--notice-info-bg);
    border-color: var(--notice-info-border);
}

.notice.warn {
    background: var(--notice-warn-bg);
    border-color: var(--notice-warn-border);
}

.notice.ok {
    background: var(--notice-ok-bg);
    border-color: var(--notice-ok-border);
}

/* ---- Meta / Footer ------------------------------------------------------- */
.meta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: .5rem;
}

footer.page-foot {
    margin: 2rem 0 3rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    color: var(--muted-text);
    font-size: .95rem;
}

/* ---- Table of contents (optional) --------------------------------------- */
.toc {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem 1rem;
    background: var(--card);
}

.toc h3 {
    margin-top: .25rem;
    margin-bottom: .5rem;
}

.toc ul {
    margin: 0;
}

/* ---- Accessibility helpers ---------------------------------------------- */
sr-only,
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Print tweaks -------------------------------------------------------- */
@media print {
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    a {
        text-decoration: underline;
    }

    .notice {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}