h2 {
  padding-top: 0.2em;
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.28rem;
}

h4 {
  font-size: 1.05rem;
}

p,
li {
  font-size: 1.02rem;
}

.content p {
  margin: 0.75em 0;
}

.content > p,
.content > ul,
.content > ol,
.content > blockquote,
.content > .nutshell-block,
.content > .table-wrap {
  max-width: var(--content-width);
}

.note-block {
  margin: 1.1rem 0;
  padding: 0.9rem 1rem;
  background: var(--accent-soft);
  border-radius: 8px;
}

.nutshell-block {
  position: relative;
  margin: 1.9rem 0 1.45rem;
  padding: 1.55rem 1.05rem 1.05rem;
  border: 2px solid #00cfd2;
  border-radius: 8px;
  background: var(--surface-strong);
}

.nutshell-title {
  position: absolute;
  top: -0.82rem;
  left: 0.9rem;
  padding: 0.28rem 0.78rem;
  min-width: 8.5rem;
  border-radius: 3px;
  background: #00004d;
  color: white;
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1;
}

.nutshell-content {
  display: grid;
  gap: 0.35rem;
  align-items: center;
}

.nutshell-content .math.display {
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--table-line);
  border-radius: 8px;
  background: var(--surface-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

thead {
  border-bottom: 1px solid var(--table-line);
}

th,
td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid var(--table-line);
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

.math.display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
}

.content img {
  display: block;
  width: 75%;
  max-width: 75%;
  height: auto;
  margin: 1.2rem auto;
}

code,
pre {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

pre {
  overflow: auto;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  text-decoration: none;
}

.pager-link span {
  color: var(--muted);
  font-size: 0.82rem;
}

.pager-link-next {
  text-align: right;
}

.home .site-main {
  padding-top: 54px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  max-width: 1120px;
  margin: 0 auto 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.home-hero .eyebrow {
  max-width: 780px;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.note-page__header .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.13rem;
}

.alice-quote {
  max-width: 780px;
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid rgb(147, 145, 164);
  border-radius: 0 8px 8px 0;
  background: rgb(147, 145, 164);
  color: #ffffff;
}

.alice-quote p {
  margin: 0.35rem 0;
  color: #ffffff;
}

.alice-quote footer {
  margin-top: 0.7rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 650;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  min-width: 180px;
}

.home-actions .button {
  width: 100%;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}
