:root {
  color-scheme: light dark;
  --text: #1f2328;
  --muted: #656d76;
  --link: #0b57d0;
  --border: #e5e7eb;
  --bg: #ffffff;
  --code-bg: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e6e6;
    --muted: #9aa0a6;
    --link: #8ab4f8;
    --border: #2f3336;
    --bg: #121212;
    --code-bg: #1e1e1e;
  }
}

* { box-sizing: border-box; }

html { font-size: clamp(16px, 0.5vw + 11px, 19.5px); }

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main :is(p, li, blockquote, td) a { text-decoration: underline; text-underline-offset: 0.15em; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin-bottom: 3rem;
}
.site-title { color: var(--text); font-weight: 600; }
.site-header nav a { color: var(--muted); margin-left: 1.25rem; }
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a[aria-current="page"] { color: var(--text); }

h1, h2, h3 { 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; }

.meta { color: var(--muted); font-size: 0.9rem; }
.meta { margin-top: -0.25rem; }


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

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em; }
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 1rem; border-radius: 6px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }

img { max-width: 100%; height: auto; }

.avatar {
  float: right;
  width: 160px;
  height: 160px;
  margin: 0.25rem 0 1rem 1.75rem;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.75rem; text-align: left; }

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--muted); margin-right: 1.25rem; }

@media (max-width: 480px) {
  body { font-size: 1.0625rem; padding-top: 1.5rem; }
  .avatar { width: 112px; height: 112px; margin-left: 1.25rem; }
  .book-list li { flex-direction: column; gap: 0.75rem; }
}

.cover { display: block; border-radius: 3px; box-shadow: 0 0 0 1px var(--border), 0 2px 8px rgb(0 0 0 / 0.12); }

.book-list { list-style: none; padding: 0; }
.book-list li { display: flex; gap: 1.5rem; margin-bottom: 2.5rem; }
.book-list .cover { flex: 0 0 auto; width: 120px; }
.book-list h2 { margin-top: 0; }
.book-list h2 a { color: var(--text); text-decoration: none; }

.book { display: flex; gap: 2rem; align-items: flex-start; }
.book .cover { flex: 0 0 auto; width: 240px; }

.buy-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
main .button {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  text-decoration: none;
}
main .button:hover { border-color: var(--link); }

@media (max-width: 600px) {
  .book { flex-direction: column; }
  .book .cover { width: 180px; }
}
