/* normalize-ish reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

/* theme variables (GitHub-like light & dark) */
:root {
    /* default = light theme (GitHub-like) */
    --bg: #ffffff;
    --surface: #e9eef4ff;
    --muted: #6e7781;
    --text: #24292f;
    --accent: #0969da; /* GitHub blue */
    --border: #d0d7de;
    --code-bg: #f6f8fa;
    --radius: 8px;
    --container: 1200px;
    --gutter: 1rem;
    font-size: 16px;
    line-height: 1.5;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans",
        sans-serif;
}

/* dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --surface: #1c222a;
        --muted: #8b949e;
        --text: #c9d1d9;
        --accent: #58a6ff; /* GitHub dark accent */
        --border: #30363d;
        --code-bg: #0b1220;
    }
}

body {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* responsive container */
.container {
    width: 100%;
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: calc(var(--gutter) * 1);
    padding-right: calc(var(--gutter) * 1);
    background: transparent;
}

/* headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: inherit;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2rem;
}
h2 {
    font-size: 1.5rem;
}
h3 {
    font-size: 1.25rem;
}

/* paragraphs and links */
p {
    margin-bottom: 1rem;
    color: var(--muted);
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* lists: keep left margin for li */
ul,
ol {
    margin-left: 0; /* reset default on container */
    padding-left: 0;
    list-style-position: outside;
}
li {
    margin-left: 1.5rem; /* requested: keep margin-left 1.5rem */
    margin-bottom: 0.25rem;
    color: var(--text);
}

/* simple grid */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gutter);
}

.col {
    flex: 1 1 0%;
    min-width: 0;
}

.col-1 {
    flex: 0 0 8.3333%;
    max-width: 8.3333%;
}
.col-2 {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
}
.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}
.col-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
}
.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}
.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) / 2);
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.btn.secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* forms */
input,
textarea,
select,
button {
    font: inherit;
}
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) / 2);
    background: var(--surface);
    color: var(--text);
}
label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* code blocks & inline code */
pre,
code {
    background: var(--code-bg);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", "Helvetica Neue",
        monospace;
    font-size: 0.875rem;
    border-radius: 6px;
}
pre {
    padding: 1rem;
    overflow: auto;
}

/* borders & surfaces */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

/* utility classes */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}
.mt-1 {
    margin-top: 0.25rem;
}
.mt-2 {
    margin-top: 0.5rem;
}
.mt-3 {
    margin-top: 1rem;
}
.mb-1 {
    margin-bottom: 0.25rem;
}
.mb-2 {
    margin-bottom: 0.5rem;
}
.mb-3 {
    margin-bottom: 1rem;
}
.hidden {
    display: none !important;
}

/* responsive tweaks */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.125rem;
    }
    .col-3,
    .col-4,
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    body {
        padding: 1rem;
    }
}

/* footer */
footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

main {
    flex: 1;
    padding: 1.5rem;
}

/* header */
header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

nav a::after {
    content: " > ";
    display: inline-block;
    width: 0.5rem;
}

nav a:last-child::after {
    display: none;
}