.curriculum-chapter {
  width: 100%;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.55;
}

.curriculum-chapter > .section:first-child,
.curriculum-chapter > .chapter:first-child {
  margin-top: 0;
}

.chapter-status,
.chapter-error {
  margin: 0;
  padding: 3rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
  font-family: var(--fancy-font);
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.chapter-error {
  border: 1px solid var(--danger);
  color: #ffd5d3;
}

.curriculum-chapter p,
.curriculum-chapter li {
  font-size: 1.08rem;
}

.curriculum-chapter p {
  margin: 0.8rem 0;
}

.curriculum-chapter ul,
.curriculum-chapter ol {
  padding-left: 1.6rem;
}

.curriculum-chapter img,
.info-content img {
  max-width: 100%;
  height: auto;
  margin: 0.4rem 0.25rem;
  border-radius: 7px;
  vertical-align: middle;
}

.curriculum-chapter .section,
.curriculum-chapter .chapter {
  overflow: hidden;
  margin-top: 2rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.curriculum-chapter .section-title,
.curriculum-chapter .chapter-title {
  margin: 0;
  padding: 1rem clamp(0.85rem, 2.5vw, 1.5rem);
  border-radius: 0;
  background: var(--surface-active);
  font-family: var(--fancy-font);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.25;
  text-align: center;
}

.curriculum-chapter .celltitle {
  padding: 1.3rem clamp(0.85rem, 2.5vw, 1.5rem) 0.35rem;
  color: var(--accent);
  font-family: var(--fancy-font);
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.3;
}

.curriculum-chapter .cell {
  padding: 0.25rem clamp(0.85rem, 2.5vw, 1.5rem) 1.25rem;
}

.curriculum-chapter .twocolumns {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.curriculum-chapter .column {
  flex: 1 1 0;
  min-width: 0;
}

.curriculum-chapter .cornerstoneList {
  display: grid;
  gap: 0.8rem;
}

.curriculum-chapter .cornerstone {
  padding: 0.8rem;
  border-radius: 10px;
  background: rgb(255 255 255 / 6%);
}

.scratch-embed {
  width: min(100%, 485px);
  margin: 1rem auto;
  aspect-ratio: 485 / 402;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 7px 20px rgb(0 0 0 / 25%);
}

.scratch-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.scratch-project-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.1rem auto;
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  background: #855cd6;
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 16px rgb(0 0 0 / 20%);
}

.scratch-project-link:hover {
  background: #976de4;
  color: white;
}

.curriculum-info-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: white;
  box-shadow: 0 5px 12px rgb(0 0 0 / 20%);
  cursor: pointer;
}

.curriculum-info-button img {
  margin: 0;
}

.curriculum-info-button:hover {
  background: #f29216;
}

@media (max-width: 650px) {
  .curriculum-chapter {
    font-size: 1rem;
  }

  .curriculum-chapter p,
  .curriculum-chapter li {
    font-size: 1rem;
  }

  .curriculum-chapter .twocolumns {
    flex-direction: column;
  }

  .curriculum-chapter img[width] {
    min-width: min(100%, 220px);
  }
}
