@import url("./common.css");

.spy-page {
  max-width: 42rem;
  padding-bottom: 4rem;
}

.spy-page__intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.spy-page__intro strong {
  color: var(--text);
}

.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem 0;
  margin: 0 -0.25rem 1.5rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  background: rgba(245, 243, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.chapter-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.chapter-nav a:hover {
  color: var(--text);
}

.chapter-nav a.is-active {
  color: var(--accent);
  border-bottom-color: currentColor;
}

/* Tall sections so the page always scrolls — scroll-spy is only visible when you scroll */
.spy-section {
  scroll-margin-top: 5rem;
  margin-bottom: 0;
  min-height: min(78vh, 38rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.spy-section:last-of-type {
  border-bottom: none;
  min-height: min(70vh, 36rem);
}

.spy-section h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.spy-section p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 60ch;
}

.spy-section p:last-child {
  margin-bottom: 0;
}

.demo-hint {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
