@font-face {
  font-family: "New Computer Modern Book";
  src: url("../../theme/fonts/computer-modern/NewCM10-Book.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Book";
  src: url("../../theme/fonts/computer-modern/NewCM10-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Book";
  src: url("../../theme/fonts/computer-modern/NewCM10-BookItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Book";
  src: url("../../theme/fonts/computer-modern/NewCM10-BoldItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Mono Book";
  src: url("../../theme/fonts/computer-modern/NewCMMono10-Book.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Mono Book";
  src: url("../../theme/fonts/computer-modern/NewCMMono10-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Mono Book";
  src: url("../../theme/fonts/computer-modern/NewCMMono10-BookItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "New Computer Modern Mono Book";
  src: url("../../theme/fonts/computer-modern/NewCMMono10-BoldOblique.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  --content-max-width: 740px;
  --mono-font: "New Computer Modern Mono Book", "Cascadia Code",
    "SFMono-Regular", Consolas, monospace;
  --page: #f4efe5;
  --paper: #fffdf7;
  --ink: #292923;
  --muted-ink: #66645b;
  --accent: #266f6a;
  --rule: #d9cfbd;
}

html.light,
html.rust {
  --bg: var(--page);
  --fg: var(--ink);
  --sidebar-bg: #ebe4d7;
  --sidebar-fg: #34342e;
  --sidebar-active: var(--accent);
  --links: #176963;
  --quote-bg: #eee8dc;
  --quote-border: #bf8b3e;
  --table-border-color: var(--rule);
  --table-header-bg: #e8e0d2;
  --table-alternate-bg: #faf6ee;
}

body {
  font-family: "New Computer Modern Book", Georgia, "Times New Roman", serif;
  line-height: 1.72;
}

.content main {
  max-width: var(--content-max-width);
  padding: 3.5rem 3rem 6rem;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(82, 69, 48, 0.06), 0 18px 60px rgba(69, 54, 32, 0.08);
  font-size: 1.75rem;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: "New Computer Modern Book", Georgia, "Times New Roman", serif;
  line-height: 1.18;
}

h1 {
  margin-bottom: 2.2rem;
  font-size: 3.2rem;
  letter-spacing: -0.025em;
}

h2 {
  margin-top: 3.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 2.3rem;
}

h3 {
  font-size: 1.9rem;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

code,
pre {
  font-family: var(--mono-font);
}

code {
  font-size: 0.84em;
}

pre {
  margin: 1.8rem -1.2rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid rgba(92, 121, 116, 0.28);
  border-radius: 8px;
  line-height: 1.55;
  font-size: 1.5rem;
}

pre code {
  font-size: inherit;
}

table {
  font-size: 1.5rem;
}

.truth-table {
  width: min(100%, 42rem);
  table-layout: fixed;
}

.truth-table th:first-child {
  border-right-width: 2px;
  border-right-color: var(--table-border-color);
}

blockquote {
  margin: 2rem 0;
  padding: 0.2rem 1.25rem;
  border-left-width: 4px;
  font-style: normal;
}

.book-illustration {
  width: 100%;
  max-width: 680px;
  margin: 3rem auto 3.4rem;
  text-align: center;
}

.book-illustration img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.book-illustration figcaption {
  max-width: 680px;
  margin: 1rem auto 0;
  color: var(--muted-ink);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
}

.book-diagram img {
  border: 1px solid var(--rule);
}

.relational-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 1.2rem;
  margin: 2rem 0;
  font-size: 1.8rem;
}

.sidebar,
.menu-title,
.nav-chapters,
.mobile-nav-chapters,
.icon-button {
  font-family: Inter, "Segoe UI", sans-serif;
}

@media (max-width: 800px) {
  .content main {
    padding: 2.2rem 1.35rem 4rem;
    box-shadow: none;
  }

  h1 {
    font-size: 2.8rem;
  }

  pre {
    margin-right: -0.5rem;
    margin-left: -0.5rem;
  }

  .book-illustration {
    width: 100%;
    margin-top: 2.2rem;
    margin-bottom: 2.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
