:root {
    --max-width: 1200px;
    --content-padding: 2rem;
    --primary-color: #c41230; /* body link color */
    --border-color: #d1d9e0;
    --bg-color: #fefefe; /* body background */
    --text-color: #000000; /* body text */
    --code-bg: #f6f8fa;
    --header-bg: #c41230; /* nav background */
    --shadow: 0 1px 3px rgba(31, 35, 40, 0.12);
    --nav-offset: 56px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Noto Sans", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    font-size: 16px;
    padding-top: var(--nav-offset);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--content-padding);
}

/* Reduce top gap below fixed nav */
main.container {
    padding-top: calc(var(--content-padding) - 12px);
}

main.container > h1:first-child {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    font-size: 2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.25em;
}
h4 {
    font-size: 1em;
}
h5 {
    font-size: 0.875em;
}
h6 {
    font-size: 0.85em;
}

p {
    margin-bottom: 16px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul,
ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

li {
    margin-bottom: 0.25em;
}

/* Code */
code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: var(--code-bg);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
        "Liberation Mono", Menlo, monospace;
}

pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: var(--code-bg);
    border-radius: 6px;
    margin-bottom: 16px;
}

pre code {
    padding: 0;
    margin: 0;
    background: transparent;
    font-size: 100%;
}

/* Blockquotes */
blockquote {
    padding: 0 1em;
    color: var(--text-color);
    border-left: 0.25em solid var(--border-color);
    margin-bottom: 16px;
    opacity: 0.8;
}

blockquote > :last-child {
    margin-bottom: 0;
}

/* Tables */
table {
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
    overflow: auto;
}

table th,
table td {
    padding: 6px 13px;
    border: 1px solid var(--border-color);
}

table tr {
    background-color: var(--bg-color);
}

table tr:nth-child(2n) {
    background-color: var(--header-bg);
}

table th {
    font-weight: 600;
    background-color: var(--header-bg);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px 0;
}

/* Horizontal rules */
hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: var(--border-color);
    border: 0;
}

/* Details/Summary */
details {
    margin-bottom: 16px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}

/* Keyboard */
kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
    color: var(--text-color);
    vertical-align: middle;
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 var(--border-color);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
        "Liberation Mono", Menlo, monospace;
}

/* Task lists */
.task-list-item {
    list-style-type: none;
}

.task-list-item input[type="checkbox"] {
    margin-right: 0.5em;
}

/* Responsive video/iframe */
iframe {
    width: 100%;
    max-width: 100%;
    height: 800px;
    margin: 16px 0;
}

video {
    width: 100%;
    max-width: 100%;
    margin: 16px 0;
}

/* Site navigation (fixed, full viewport width) */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.site-nav .container {
    padding-top: 12px;
    padding-bottom: 12px;
}

.site-nav .inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.site-nav .site-title {
    font-weight: 700;
    color: #ffffff; /* nav title color */
    text-decoration: none;
    margin-right: 12px;
}

.site-nav .site-links a {
    margin-right: 12px;
    color: #ffffff; /* nav link color */
}

@media (max-width: 640px) {
    :root {
        --nav-offset: 96px;
    }
    .site-nav .inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .site-nav .site-links a {
        margin-right: 8px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
    }
}
