:root {
  --paper: #f7f2e9;
  --ink: #20201d;
  --muted: #68645c;
  --line: #d8cfc0;
  --accent: #8b352d;
  --code: #eee6d9;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.62;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: .8rem max(1rem, calc((100vw - 900px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

nav { display: flex; flex-wrap: wrap; gap: .9rem; }
nav a { font-size: .9rem; }

.document {
  width: min(900px, calc(100% - 2rem));
  min-height: 75vh;
  margin: 2.25rem auto 4rem;
}

h1, h2, h3 { line-height: 1.2; }
h1 { margin-top: 0; font-size: clamp(2rem, 5vw, 3rem); }
h2 { margin-top: 2.4rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
h3 { margin-top: 1.8rem; }

blockquote {
  margin-left: 0;
  padding: .25rem 1rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

code {
  padding: .1em .3em;
  border-radius: .2rem;
  background: var(--code);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: .85em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--code);
}

pre code { padding: 0; background: transparent; }
.source-code { font-size: .78rem; line-height: 1.45; }
.source-download { margin-bottom: 1.5rem; }

table {
  display: block;
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
}

th, td { padding: .45rem .7rem; border: 1px solid var(--line); }
th { text-align: left; background: var(--code); }

.site-footer {
  padding: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
}

@media (max-width: 650px) {
  html { font-size: 16px; }
  .site-header { position: static; align-items: flex-start; flex-direction: column; gap: .4rem; }
  .document { margin-top: 1.5rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171715;
    --ink: #e9e1d4;
    --muted: #b8afa2;
    --line: #423d35;
    --accent: #e28a78;
    --code: #24211d;
  }
}
