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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    display: grid;
    grid-template-columns: 1fr min(100%, 900px) 1fr;
}

main {
    display: contents;
}

header {
    background-color: #2c3e50;
    color: white;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr min(100%, 900px) 1fr;
    padding: 2rem 0;
}

header > * {
    grid-column: 2;
    padding-inline: 1rem;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
}

section {
    grid-column: 2;
    padding: 2rem 1rem;
}

section > * {
    margin-left: 0;
    margin-right: 0;
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    margin-top: 0;
}

section h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

section p {
    margin-bottom: 1rem;
}

section p:last-child {
    margin-bottom: 0;
}

section ul {
    margin-left: 2rem;
    margin-bottom: 0;
}

section li {
    margin-bottom: 0.5rem;
}

section article {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

/* Full-bleed */
section[data-fullbleed] {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr min(100%, 900px) 1fr;
    padding: 2rem 0;
}

section[data-fullbleed] > * {
    grid-column: 2;
    padding-inline: 1rem;
}

section[data-fullbleed][data-bg="light"] {
    background-color: #ecf0f1;
}

section[data-fullbleed][data-bg="blue"] {
    background-color: #3498db;
    color: white;
}

section[data-fullbleed][data-bg="image"] {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><rect fill="%23663399" width="1200" height="400"/><circle cx="200" cy="100" r="80" fill="%239966cc" opacity="0.6"/><circle cx="1000" cy="300" r="120" fill="%23cc99ff" opacity="0.4"/><path d="M0 250 Q300 200 600 250 T1200 250 L1200 400 L0 400" fill="%23552288" opacity="0.5"/></svg>');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
}

section[data-fullbleed]:not([data-bg]) {
    border-top: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
}

code-block {
    display: block;
    background-color: #f5f5f5;
    border-left: 4px solid #3498db;
    margin: 1.5rem 0;
    padding: 1rem;
    overflow-x: auto;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

section[data-fullbleed][data-bg="light"] code-block {
    background-color: white;
    border-left-color: #2c3e50;
}

/* Links */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

section[data-fullbleed][data-bg="blue"] a {
    color: white;
    text-decoration: underline;
}

section[data-fullbleed][data-bg="blue"] a:hover {
    opacity: 0.9;
}

footer {
    background-color: #2c3e50;
    color: white;
    margin-top: 2rem;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr min(100%, 900px) 1fr;
    padding: 2rem 0;
}

footer > * {
    grid-column: 2;
    padding-inline: 1rem;
}

footer h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }

    section h2 {
        font-size: 1.5rem;
    }
}
