/* Tokens to Transformers — a book, not a blog.
   Serif body, generous measure. No sidebars, no dates, no tags.
   Paper-light theme: warm paper page, dark ink, amber links,
   code on solid dark surfaces. */

:root {
  --bg: #faf8f2;
  --ink: #1c1a17;
  --muted: #6b655c;
  --accent: #b45309;
  --accent-hover: #78350f;
  --rule: rgba(28, 26, 23, 0.18);
  --box: transparent;
  --code: #161b22;
  --code-ink: #e6edf3;
  --code-inline-bg: #f0e7d3;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  min-height: 100vh;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
}

p, li { text-wrap: pretty; }
main p { text-align: justify; hyphens: auto; }

.wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header: a thin rule with the book's name, nothing else. */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0;
  font-size: 1rem;
  background: transparent;
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--accent-hover); }

/* Type */
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.1rem; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.5rem; margin: 2.2em 0 0.7em; }
h3 { font-size: 1.2rem; margin: 1.8em 0 0.6em; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* Cover */
.kicker {
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  margin: 2.5rem 0 0;
}
.lede {
  font-size: 1.3rem;
  line-height: 1.6;
}

.cta {
  display: inline-block;
  margin: 1rem 0 0.5rem;
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  color: #fffdf7;
  text-decoration: none;
  border-radius: 3px;
  font-size: 1.1rem;
  font-weight: 600;
}
.cta:hover { color: #fffdf7; background: var(--accent-hover); }

/* Chapter list: the table of contents. */
.chapter-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
}
.chapter-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.chapter-list li:first-child { border-top: 1px solid var(--rule); }
.chapter-list a {
  text-decoration: none;
  font-size: 1.25rem;
  color: var(--ink);
}
.chapter-list a:hover { color: var(--accent); }
.chnum {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}
.chapter-list p { margin: 0.3rem 0 0; }

.coming-next { padding-left: 1.2rem; }
.coming-next li { margin: 0.5rem 0; }
.status {
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05rem 0.45rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* Boxes: "What this chapter covers", "Code for this chapter". */
blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1.2rem;
  background: var(--box);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 1.02rem;
  box-shadow: 0 4px 20px rgba(28, 26, 23, 0.12);
}
blockquote p { margin: 0.5rem 0; }
blockquote ul, blockquote ol { margin: 0.5rem 0; padding-left: 1.3rem; }

/* In-chapter table of contents (kramdown {:toc}). */
#markdown-toc {
  border: 1px solid var(--rule);
  background: var(--box);
  box-shadow: 0 4px 20px rgba(28, 26, 23, 0.12);
  padding: 1rem 1.2rem;
  font-size: 1rem;
  list-style: none;
}
#markdown-toc::before {
  content: "In this chapter";
  display: block;
  margin-bottom: 0.4rem;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--muted);
}
#markdown-toc a { text-decoration: none; color: var(--ink); }
#markdown-toc a:hover { color: var(--accent); }

/* Code: inline tokens on a paper tint, blocks on solid dark surfaces. */
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--code-inline-bg);
  color: var(--ink);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
pre {
  background: var(--code);
  color: var(--code-ink);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  border-radius: 4px;
  line-height: 1.6;
  box-shadow: 0 4px 20px rgba(28, 26, 23, 0.18);
}
pre code { background: none; color: var(--code-ink); padding: 0; }

/* Tables */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.98rem;
  display: block;
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
}
th, td {
  padding: 0.45rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
thead th { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }

/* Prev / next: the book's only navigation. */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.prev-next a, .prev-next .soon {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--ink);
  height: 100%;
  box-shadow: 0 4px 20px rgba(28, 26, 23, 0.12);
}
.prev-next a:hover { border-color: var(--accent); }
.prev-next span span, .prev-next a span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}
.pn-next { text-align: right; }
.soon { color: var(--muted); background: var(--box); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 1.2rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: transparent;
}
.site-footer a { color: var(--muted); }

@media (max-width: 40rem) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.7rem; }
  .prev-next { grid-template-columns: 1fr; }
}
