:root {
  --book-navy: #123458;
  --book-blue: #1769aa;
  --book-cyan: #2a91a8;
  --book-paper: #f8fafc;
  --md-primary-fg-color: var(--book-navy);
  --md-accent-fg-color: var(--book-blue);
  --md-text-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --md-code-font: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

body,
input {
  font-family: var(--md-text-font);
  font-feature-settings: "kern", "liga", "calt";
}

.md-header,
.md-tabs {
  background: var(--book-navy);
}

.md-header__title,
.md-tabs__link,
.md-nav,
.md-footer {
  font-family: var(--md-text-font);
}

.md-typeset {
  color: #243447;
  font-size: 0.78rem;
  line-height: 1.68;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: #14283d;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.md-typeset h1 {
  margin-bottom: 0.55em;
  font-size: 2.15em;
}

.md-typeset h2 {
  margin-top: 1.8em;
  padding-bottom: 0.28em;
  border-bottom: 1px solid rgba(18, 52, 88, 0.12);
}

.md-typeset code,
.md-typeset pre,
.md-typeset kbd {
  font-family: var(--md-code-font);
}

.md-typeset code {
  font-size: 0.88em;
}

.md-typeset pre > code {
  font-size: 0.71rem;
  line-height: 1.52;
}

.book-hero {
  margin: 0.4rem 0 2.6rem;
  padding: 3.4rem 3.6rem 2.4rem;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(120deg, rgba(18, 52, 88, 0.98), rgba(20, 82, 125, 0.94)),
    linear-gradient(30deg, transparent 35%, rgba(255, 255, 255, 0.08));
  border-radius: 0.55rem;
  box-shadow: 0 1rem 2.8rem rgba(18, 52, 88, 0.17);
}

.md-typeset .book-hero h1 {
  max-width: 15ch;
  margin: 0.15rem 0 0.35rem;
  color: white;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.book-hero .md-button {
  margin: 0.2rem 0.35rem 0.2rem 0;
  border-color: rgba(255, 255, 255, 0.65);
  color: white;
}

.book-hero .md-button--primary {
  border-color: white;
  background: white;
  color: var(--book-navy);
}

.book-stats {
  display: flex;
  gap: 1.8rem;
  margin-top: 2.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.book-stats strong {
  color: white;
  font-size: 0.78rem;
}

.md-typeset .grid.cards > ul > li {
  border-color: rgba(18, 52, 88, 0.12);
  border-radius: 0.42rem;
  box-shadow: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 105, 170, 0.45);
  box-shadow: 0 0.7rem 1.6rem rgba(18, 52, 88, 0.09);
}

.card-count {
  color: var(--book-blue);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 2.2rem;
  margin: 0 0 1.7rem;
  padding: 0.85rem 1rem;
  background: #f2f6f9;
  border-left: 3px solid var(--book-cyan);
  border-radius: 0 0.3rem 0.3rem 0;
}

.module-meta span {
  display: grid;
  gap: 0.1rem;
  color: #263d54;
}

.module-meta small {
  color: #718197;
  font-size: 0.57rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.formula-card {
  margin: 0.5rem 0 1.45rem;
  padding: 0.75rem 1.2rem;
  overflow-x: auto;
  color: #163650;
  background: linear-gradient(110deg, #f1f7fa, #f8fafc);
  border: 1px solid #dce8ee;
  border-radius: 0.35rem;
}

.formula-card .arithmatex {
  margin: 0.15rem 0;
}

.source-link {
  font-size: 0.72rem;
  font-weight: 650;
}

[data-md-color-scheme="slate"] .md-typeset,
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3 {
  color: var(--md-default-fg-color);
}

[data-md-color-scheme="slate"] .module-meta,
[data-md-color-scheme="slate"] .formula-card {
  color: #d2e3ef;
  background: #172736;
  border-color: #2b465b;
}

@media screen and (max-width: 44.984375em) {
  .book-hero {
    margin-top: 0;
    padding: 2.2rem 1.35rem 1.6rem;
    border-radius: 0;
  }

  .book-stats {
    gap: 0.75rem;
    justify-content: space-between;
  }

  .book-stats span {
    display: grid;
  }

  .module-meta {
    display: grid;
    gap: 0.75rem;
  }
}
