:root {
  --site-ink: #172033;
  --site-accent: #315c9f;
}

body { color: var(--site-ink); }
a { text-underline-offset: 0.16em; }

a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(49, 92, 159, 0.45);
  outline-offset: 3px;
}

.skip-link {
  background: #fff;
  border: 2px solid var(--site-accent);
  border-radius: 0.25rem;
  color: var(--site-accent);
  font-weight: 700;
  left: 1rem;
  padding: 0.75rem 1rem;
  position: fixed;
  top: -6rem;
  z-index: 2000;
}

.skip-link:focus { top: 1rem; }
.site-header { position: relative; z-index: 10; }

.catalog-hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(117, 164, 219, 0.22), transparent 28rem),
    linear-gradient(135deg, #f8fbff, #eef3f9);
}

.book-card {
  border-top: 0.3rem solid var(--site-accent) !important;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.book-card:hover,
.book-card:focus-within {
  box-shadow: 0 1rem 2rem rgba(23, 32, 51, 0.12) !important;
  transform: translateY(-0.2rem);
}

.book-content {
  font-size: 1.075rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.book-content > :first-child { margin-top: 0; }

.book-content h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.12;
  margin-bottom: 1.5rem;
}

.book-content h2 {
  border-top: 1px solid var(--bs-border-color);
  font-size: 1.65rem;
  margin-top: 3rem;
  padding-top: 2rem;
}

.book-content h3 { font-size: 1.3rem; margin-top: 2rem; }

.book-content blockquote {
  background: var(--bs-tertiary-bg);
  border-left: 0.3rem solid var(--site-accent);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
}

.book-content blockquote > :last-child { margin-bottom: 0; }

.book-content table {
  border-collapse: collapse;
  display: block;
  margin: 1.5rem 0;
  max-width: 100%;
  overflow-x: auto;
  width: max-content;
}

.book-content th,
.book-content td {
  border: 1px solid var(--bs-border-color);
  overflow-wrap: normal;
  padding: 0.65rem 0.8rem;
  vertical-align: top;
}

.book-content th { background: var(--bs-tertiary-bg); font-weight: 700; }

.book-guide-nav {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.guide-section summary { cursor: pointer; }

.guide-link {
  border-left: 0.2rem solid transparent;
  color: var(--bs-secondary-color);
  display: block;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  text-decoration: none;
}

.guide-link:hover,
.guide-link.active {
  background: var(--bs-tertiary-bg);
  border-left-color: var(--site-accent);
  color: var(--site-accent);
}

@media (min-width: 992px) {
  .book-guide-nav { position: sticky; top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .book-card { transition: none; }
}
