/* Shared styles for /book/ and /about/ — matches the home page theme */
body { font-family: Georgia, Cambria, serif; font-size: 18px; line-height: 1.7; color: #e8e8e8; background: #000; margin: 0; }
a { color: #9cc4e4; }
nav.side { position: fixed; top: 0; left: 0; bottom: 0; width: 175px; background: #000; border-right: 1px solid #2a2a2a; padding-top: 50px; }
nav.side a { display: block; padding: 0.75rem 0.5rem 0.75rem 20px; color: #e8e8e8; text-decoration: none;
  font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 600; letter-spacing: 0.05em; font-size: 1.05em; }
nav.side a:hover { background: #222; }
.page { margin-left: 175px; }
header { border-bottom: 1px solid #2a2a2a; }
header .inner { max-width: 1536px; margin: 0 auto; padding: 1rem 2rem; }
header h2 { margin: 0; font-size: 1.4em; }
header h2 a { color: #e8e8e8; text-decoration: none; }
main { max-width: 46em; margin: 0 auto; padding: 20px 2rem 2rem; }
h1, h2, h3 { font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 600; margin: 1.5em 0 0.5em; line-height: 1.25; }
h1 { font-size: 2.1em; margin-top: 0.6em; }
h2 { font-size: 1.4em; }
footer { border-top: 1px solid #2a2a2a; margin-top: 3rem; padding: 1.5rem 1rem 0; text-align: center; color: #ccc; font-size: 0.9em; }
footer { padding-bottom: 1.5rem; }

nav.side a .nav-sub { display: block; font-size: 0.72em; font-weight: 400; letter-spacing: 0.04em; color: #8a8a8a; margin-top: 1px; }
nav.side a:hover .nav-sub { color: #b5b5b5; }

/* chapters */
article p { margin: 0 0 1.1em; }
img.diagram { display: block; max-width: 100%; height: auto; margin: 0 auto 1.5em; border-radius: 6px; background: #fff; }
.crumb { font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 0.85em; letter-spacing: 0.05em; margin-top: 0.6em; }
.crumb a { color: #9cc4e4; text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 1.2em 0;
  font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 0.9em; }
.pager a { text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager .toc { color: #bbb; }

/* landing page */
.bookhead { display: flex; gap: 2rem; align-items: flex-start; margin-top: 1rem; }
.bookhead img.cover { width: 240px; height: auto; border-radius: 4px; box-shadow: 0 2px 16px rgba(0,0,0,.8); flex-shrink: 0; }
.bookhead h1 { margin-top: 0; }
.by { color: #bbb; font-style: italic; margin-top: -0.4em; }
.free { margin-top: 1.4em; }
a.start { display: inline-block; margin-left: 0.4em; padding: 0.35em 0.9em; border: 1px solid #9cc4e4; border-radius: 4px; text-decoration: none;
  font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 600; }
a.start:hover { background: #12202c; }
ol.contents { list-style: none; padding: 0; margin: 0; border-top: 1px solid #2a2a2a; }
ol.contents li { border-bottom: 1px solid #2a2a2a; }
ol.contents a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55em 0.3em; text-decoration: none; color: #e8e8e8; }
ol.contents a:hover { background: #151515; }
ol.contents .s { color: #9a9a9a; font-size: 0.9em; white-space: nowrap; }
.note { color: #9a9a9a; font-size: 0.85em; margin-top: 2em; }

@media (max-width: 760px) {
  body { font-size: 17px; }
  nav.side { position: static; width: auto; bottom: auto; border-right: none; border-bottom: 1px solid #2a2a2a; padding-top: 0; display: flex; flex-wrap: wrap; }
  nav.side a { padding: 0.7rem 1rem; font-size: 0.95em; }
  .page { margin-left: 0; }
  header .inner { padding: 0.8rem 1rem; }
  main { padding: 12px 1rem 1.5rem; }
  h1 { font-size: 1.55em; }
  .bookhead { flex-direction: column; align-items: center; }
  .pager { flex-wrap: wrap; justify-content: center; }
}
