.glossary-hero {
  position: relative;
  padding-top: clamp(72px, 8vw, 112px);
  padding-bottom: clamp(64px, 8vw, 104px);
  overflow: hidden;
  text-align: center;
}

.glossary-hero::before,
.glossary-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: var(--radius-pill);
  background: var(--color-accent-a08);
}

.glossary-hero::before {
  width: min(68vw, 760px);
  height: min(38vw, 360px);
  top: 4%;
  left: -18%;
  transform: rotate(-8deg);
}

.glossary-hero::after {
  width: min(54vw, 620px);
  height: min(30vw, 300px);
  right: -15%;
  bottom: 4%;
  background: var(--color-accent-a06);
  transform: rotate(9deg);
}

.glossary-hero h1 {
  max-width: 800px;
  margin: 24px auto 0;
}

.glossary-hero__lead {
  max-width: 720px;
  margin: 22px auto 0;
  color: var(--color-muted);
  font-size: clamp(17px, 2vw, 20px);
}

.glossary-summary {
  max-width: 760px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 0;
}

.glossary-summary span {
  min-height: 38px;
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  background: var(--color-panel);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
}

.glossary-summary strong {
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
}

.glossary-toc {
  top: 10px;
}

.index-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 34px;
  align-items: start;
}

.index-panel__copy h2 {
  font-size: clamp(24px, 2.5vw, 32px);
}

.index-panel__copy p {
  margin: 12px 0 0;
  color: var(--color-muted);
}

.term-index {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 9px;
}

.term-index a {
  min-height: 36px;
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}

.term-index a:hover {
  color: var(--color-white);
  background: var(--color-accent);
}

.term-section {
  scroll-margin-top: 12px;
}

.term-section .section-heading {
  max-width: 800px;
}

.term-section .section-heading h2 {
  margin-top: 14px;
}

.term-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.term-layout .term-card {
  scroll-margin-top: 90px;
}

.term-layout .term-card__head {
  flex-wrap: wrap;
}

.term-layout .term-card__head code {
  max-width: 100%;
  color: var(--color-accent-dark);
  font-size: 12px;
}

.term-layout .term-card p {
  line-height: 1.8;
}

.term-section .callout {
  margin-top: 24px;
}

.glossary-next {
  text-align: center;
}

.glossary-next h2 {
  margin-top: 16px;
}

.glossary-next p {
  max-width: 680px;
  margin: 14px auto 24px;
  color: var(--color-muted);
}

.glossary-next .cluster {
  justify-content: center;
}

@media (max-width: 760px) {
  .index-panel,
  .term-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .index-panel {
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .glossary-hero {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .glossary-hero::before {
    width: 86vw;
    height: 48vw;
  }

  .glossary-hero::after {
    width: 74vw;
    height: 42vw;
  }

  .glossary-hero h1 {
    font-size: 30px;
  }

  .glossary-hero__lead {
    font-size: 16px;
  }

  .glossary-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .glossary-summary span {
    justify-content: center;
  }

  .term-index a {
    flex: 1 1 auto;
    justify-content: center;
  }

  .glossary-next {
    text-align: left;
  }

  .glossary-next p {
    margin-inline: 0;
  }

  .glossary-next .cluster {
    align-items: stretch;
    flex-direction: column;
  }

  .glossary-next .button {
    width: 100%;
  }
}