:root {
  --bg: #fdfdfc;
  --fg: #1b1b1a;
  --muted: #5c5c58;
  --accent: #0b5cad;
  --border: #e2e1dd;
  --code-bg: #f4f3f0;
  --max-width: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #e8e8e6;
    --muted: #a3a3a0;
    --accent: #7cb7ef;
    --border: #2e2e34;
    --code-bg: #1f1f25;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  max-width: var(--max-width);
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-style: dotted; }

header.site {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.site-title { font-size: 1.35rem; font-weight: 700; text-decoration: none; color: var(--fg); }
header.site nav a { font-size: 0.85rem; color: var(--muted); }

footer.site {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.75rem; }
h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p, ul, ol, table, pre, blockquote, figure { margin: 0 0 1.1rem; }

.byline { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }

.taxa { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0; }
.taxa a {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--muted);
}
.taxa a.category { border-color: var(--accent); color: var(--accent); }

ul.post-list { list-style: none; margin: 0; padding: 0; }
ul.post-list > li.card { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
ul.post-list h2 { margin: 0 0 0.25rem; font-size: 1.25rem; }
ul.post-list h2 a { text-decoration: none; }
.excerpt { margin: 0.35rem 0 0; color: var(--fg); }

nav.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.page-of { color: var(--muted); }

.content img, .content video, .content audio { max-width: 100%; height: auto; display: block; }
.content figure { margin: 1.5rem 0; }
.content figure.media video { width: 100%; background: #000; border-radius: 4px; }
.content figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; }

blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

code, pre, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  padding: 0.9rem 1rem;
  border-radius: 5px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; }
th { background: var(--code-bg); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.footnote-definition { font-size: 0.9rem; color: var(--muted); }
.footnote-definition p { display: inline; }

.empty { color: var(--muted); }

main.error { text-align: center; padding-top: 3rem; }
main.error h1 { font-size: 3.5rem; margin-bottom: 0.5rem; }

main.login-gate { max-width: 22rem; margin-top: 5rem; }
.login-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.login-form label { font-weight: 600; }
.login-form input[type="password"] {
  width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg); color: var(--fg); font-size: 1rem;
}
.login-form button {
  align-self: flex-start; padding: 0.45rem 1.25rem; background: var(--accent);
  color: #fff; border: none; border-radius: 4px; font-size: 0.95rem; cursor: pointer;
}
.login-form button:hover { opacity: 0.88; }
.login-error { color: #c0392b; margin: 0; font-size: 0.9rem; }
