:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --text: #17201d;
  --muted: #59645f;
  --line: #c9d0ca;
  --accent: #0c7656;
  --accent-strong: #07543e;
  --highlight: #f5c851;
  --shadow: 0 14px 40px rgb(23 32 29 / 9%);
  --radius: 18px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111815;
  --surface: #18221e;
  --surface-strong: #202c27;
  --text: #f4f6f2;
  --muted: #b8c3bd;
  --line: #3a4841;
  --accent: #69d4ab;
  --accent-strong: #9be4c7;
  --highlight: #f5c851;
  --shadow: 0 14px 40px rgb(0 0 0 / 25%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: inherit;
}

/* 教材共用的媒體安全底線。單章練習仍可在後載入的 style.css 刻意改寫。 */
img,
iframe,
video {
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand__mark {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.header-actions a,
.header-actions .nav-link,
.theme-toggle {
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.header-actions .is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.58;
}

.header-actions a:hover,
.theme-toggle:hover {
  background: var(--surface-strong);
}

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 10vw, 132px) 0 76px;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  z-index: -1;
  top: 56px;
  right: 2%;
  width: 280px;
  height: 280px;
  border: 64px solid color-mix(in srgb, var(--accent) 13%, transparent);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  width: min(880px, 100%);
  margin: 0;
  font-size: clamp(2.6rem, 6.2vw, 5.9rem);
  letter-spacing: -0.055em;
}

.hero__lead {
  width: min(760px, 100%);
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 42px;
}

.hero__stats div {
  display: flex;
  min-width: 140px;
  align-items: baseline;
  gap: 8px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.hero__stats strong {
  color: var(--accent-strong);
  font-size: 1.55rem;
}

.hero__stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.chapter-quickstart {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.8fr);
  gap: 28px;
  margin: 0 0 18px;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 91%, var(--accent) 9%);
  box-shadow: var(--shadow);
}

.chapter-quickstart__heading h2 {
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.chapter-quickstart__heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.chapter-quickstart__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-quickstart__steps li {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.chapter-quickstart__number {
  display: block;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.chapter-quickstart__steps strong {
  display: block;
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.45;
}

.chapter-quickstart__steps p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.principles,
.course-section {
  padding: 84px 0;
  scroll-margin-top: 78px;
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: -0.04em;
}

.section-heading--row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.principle-grid article {
  min-height: 260px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-number {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.principle-grid h3 {
  margin: 52px 0 12px;
  font-size: 1.3rem;
}

.principle-grid p,
#scope .course-note {
  color: var(--muted);
}

.principle-grid p {
  margin: 0;
}

/* 第 02 章的媒體骨架預先避免窄螢幕溢出；本章任務只處理 src、alt 與 embed URL。 */
#profile-photo {
  display: block;
  max-width: 100%;
  height: auto;
}

#intro-video {
  display: block;
  width: min(100%, 560px);
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

.course-section {
  border-top: 1px solid var(--line);
}

.tool-map {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tool-map h3 {
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-size: 1.1rem;
}

.tool-map dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.tool-map dl > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}

.tool-map dt {
  color: var(--accent-strong);
  font-weight: 900;
}

.tool-map dd {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.debug-case-grid {
  margin-top: 28px;
}

.debug-case-grid article {
  min-height: 208px;
}

.practice-preflight {
  margin: 0 0 28px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.practice-preflight h3 {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 1.08rem;
}

.practice-preflight ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding-left: 1.2rem;
}

.practice-preflight li {
  line-height: 1.7;
}

#core-ideas .core-idea-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: core-idea;
}

#core-ideas .core-idea-grid li {
  position: relative;
  min-height: 184px;
  margin: 0;
  padding: 72px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  counter-increment: core-idea;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

#core-ideas .core-idea-grid li::before {
  position: absolute;
  top: 22px;
  left: 24px;
  color: var(--accent-strong);
  content: counter(core-idea, decimal-leading-zero);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

#core-ideas .core-idea-grid li::after {
  position: absolute;
  top: 53px;
  left: 24px;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

#core-ideas .core-idea-grid code,
#debugging .debug-timeline code {
  white-space: normal;
}

#debugging .debug-scenario {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 0 0 28px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  line-height: 1.8;
}

#debugging .debug-scenario strong {
  color: var(--accent-strong);
  letter-spacing: 0.04em;
}

#debugging .debug-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: debug-step;
}

#debugging .debug-timeline li {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 72px;
  margin: 0;
  padding: 0 0 24px 68px;
  counter-increment: debug-step;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

#debugging .debug-timeline li:last-child {
  min-height: 48px;
  padding-bottom: 0;
}

#debugging .debug-timeline li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
  content: counter(debug-step, decimal-leading-zero);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 900;
}

#debugging .debug-timeline li:not(:last-child)::after {
  position: absolute;
  top: 52px;
  bottom: 0;
  left: 23px;
  width: 2px;
  background: color-mix(in srgb, var(--accent) 30%, var(--line));
  content: "";
}

#scope .course-note {
  width: 100%;
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  font-size: 0.96rem;
  line-height: 1.8;
}

#scope .course-note strong {
  color: var(--accent-strong);
}

.course-grid {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
}

.course-grid a {
  display: grid;
  min-height: 136px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  grid-template-columns: 46px 1fr;
  gap: 4px 14px;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.course-grid a[data-missing="true"] {
  opacity: 0.58;
  cursor: not-allowed;
}

.course-grid a:not([data-missing="true"]):hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.course-grid span {
  grid-row: 1 / span 2;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.course-grid strong {
  align-self: end;
  font-size: 1.08rem;
}

.course-grid small {
  color: var(--muted);
}

/* Practice Contract：主講義的四步學習路線 */
.pc-starter-download {
  color-scheme: light;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 0 0;
  padding: 22px 24px;
  border: 1px solid #b8d7ca;
  border-radius: 18px;
  background: #f4fbf7;
  box-shadow: 0 12px 30px rgba(27, 77, 59, 0.09);
  color: #18342a;
}

.pc-starter-download__copy {
  min-width: 0;
}

.pc-starter-download__eyebrow {
  margin: 0 0 4px;
  color: #176b50;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.pc-starter-download h3 {
  margin: 0;
  color: #102b21;
  font-size: 1.2rem;
}

.pc-starter-download__copy > p:last-child {
  margin: 7px 0 0;
  color: #49655a;
  line-height: 1.65;
}

.pc-starter-download code {
  border: 1px solid #cde0d8;
  background: #ffffff;
  color: #245b46;
}

.pc-starter-download__button {
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid #176b50;
  border-radius: 12px;
  background: #176b50;
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.pc-starter-download__button:hover {
  background: #0d513b;
  color: #ffffff;
  transform: translateY(-2px);
}

.pc-starter-download__button:focus-visible {
  outline: 3px solid #d28a00;
  outline-offset: 3px;
}

.pc-flow {
  position: relative;
  display: grid;
  margin: 36px 0 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  counter-reset: none;
}

.pc-flow__step {
  position: relative;
  min-width: 0;
}

.pc-flow__step:not(:last-child)::after {
  position: absolute;
  z-index: 2;
  top: 34px;
  right: -13px;
  width: 12px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.pc-flow__link {
  position: relative;
  display: flex;
  min-height: 318px;
  height: 100%;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.pc-flow__link:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-4px);
}

.pc-flow__number {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  color: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.pc-flow__phase {
  margin-top: 24px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pc-flow__title {
  display: block;
  margin-top: 2px;
  font-size: 1.22rem;
  line-height: 1.35;
}

.pc-flow__description {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.pc-flow__status {
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.pc-flow__action {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: var(--accent-strong);
  font-weight: 900;
}

.pc-answer-link {
  margin: 20px 0 0;
}

.pc-answer-link a {
  display: grid;
  min-height: 72px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  text-decoration: none;
}

.pc-answer-link a > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-weight: 900;
}

.pc-answer-link strong,
.pc-answer-link small {
  display: block;
}

.pc-answer-link small {
  margin-top: 2px;
  color: var(--muted);
}

/* Evidence checklist：讓每一列都能直接點選，並保留原生 checkbox 的鍵盤操作。 */
.evidence-checklist__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.evidence-checklist__meta strong {
  color: var(--accent-strong);
  font-size: 1rem;
}

.evidence-checklist__meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.evidence-checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-checklist__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-height: 72px;
  padding: 16px 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.evidence-checklist__item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.evidence-checklist__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.evidence-checklist__mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--surface);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.evidence-checklist__input:checked + .evidence-checklist__mark {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.04);
}

.evidence-checklist__input:checked + .evidence-checklist__mark::after {
  content: "✓";
}

.evidence-checklist__input:focus-visible + .evidence-checklist__mark {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
}

.evidence-checklist__copy {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding-top: 3px;
}

.evidence-checklist__number {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.evidence-checklist__text {
  font-weight: 700;
}

.evidence-checklist__state {
  display: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.evidence-checklist__input:checked ~ .evidence-checklist__copy .evidence-checklist__text {
  color: var(--muted);
}

.evidence-checklist__input:checked ~ .evidence-checklist__copy .evidence-checklist__state {
  display: inline-flex;
}

/* Practice Contract：四個實作階段共用，不沿用練習頁自己的 nav。 */
.pc-stage-nav,
.pc-stage-pager {
  width: min(1180px, calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.5;
  isolation: isolate;
}

.pc-stage-nav {
  margin-top: 20px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
  box-shadow: var(--shadow);
}

.pc-stage-nav__inner {
  display: grid;
  gap: 14px;
}

.pc-stage-nav__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pc-stage-nav__lesson {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--accent-strong);
  font-weight: 900;
  text-decoration: none;
}

.pc-stage-nav__lesson:hover {
  background: var(--surface-strong);
}

.pc-stage-nav__current {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
}

.pc-stage-nav__current strong {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pc-stage-nav__steps {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.pc-stage-nav__item {
  min-width: 0;
}

.pc-stage-nav__step {
  display: grid;
  min-height: 76px;
  height: 100%;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  text-decoration: none;
}

.pc-stage-nav__step:hover {
  border-color: var(--accent);
}

.pc-stage-nav__step[aria-current="step"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 76%, var(--accent) 24%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 58%, transparent);
}

.pc-stage-nav__number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  font-weight: 900;
}

.pc-stage-nav__step[aria-current="step"] .pc-stage-nav__number {
  background: var(--accent);
  color: var(--surface);
}

.pc-stage-nav__label,
.pc-stage-nav__label small,
.pc-stage-nav__label strong {
  display: block;
  min-width: 0;
}

.pc-stage-nav__label small {
  color: var(--muted);
  font-size: 0.72rem;
}

.pc-stage-nav__label strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.pc-stage-pager {
  display: grid;
  margin-top: 32px;
  margin-bottom: 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pc-stage-pager__link {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.pc-stage-pager__link:hover {
  border-color: var(--accent);
}

.pc-stage-pager__link--next {
  align-items: flex-end;
  text-align: right;
}

.pc-stage-pager__link small {
  color: var(--accent-strong);
  font-weight: 900;
}

.pc-stage-pager__link strong {
  margin-top: 4px;
  font-size: 1.03rem;
}

/* 由 Markdown 維護來源產生的學生版 HTML 文件。 */
.pc-doc {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 96px;
}

.pc-doc__header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.pc-doc__header h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.pc-doc__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.pc-doc__nav a {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.pc-doc__content {
  padding-top: 38px;
}

.pc-doc__content h2,
.pc-doc__content h3 {
  margin-top: 42px;
}

.pc-doc__content blockquote {
  margin: 24px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
}

.pc-doc__table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.pc-doc table {
  width: 100%;
  border-collapse: collapse;
}

.pc-doc th,
.pc-doc td {
  min-width: 130px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.pc-doc th {
  color: var(--accent-strong);
}

.pc-doc pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 12px;
  background: #18221e;
  color: #f4f6f2;
}

.pc-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Creation Path：從跟做到獨立創作的跨章路徑。 */
.creation-path-link {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: var(--surface) !important;
}

.creation-path-banner {
  display: grid;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  margin: 52px 0 0;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  border-radius: 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 82%, var(--accent) 18%), var(--surface));
  box-shadow: var(--shadow);
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
}

.creation-path-banner h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.04em;
}

.creation-path-banner p:not(.eyebrow) {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
}

.creation-path-banner ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.creation-path-banner li {
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.creation-path-banner > a {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--surface);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.creation-path-banner > a:hover {
  box-shadow: 0 18px 36px color-mix(in srgb, var(--accent) 28%, transparent);
  transform: translateY(-3px);
}

.creation-path-banner > a strong {
  font-size: 1.2rem;
}

.creation-path-banner > a span {
  opacity: 0.88;
}

.creation-hero h1 {
  max-width: 980px;
}

.creation-intro .section-heading p:last-child,
#requirement-flow .section-heading p:last-child,
#creation-rubric .section-heading p:last-child {
  max-width: 820px;
  color: var(--muted);
}

.creation-loop {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  counter-reset: creation-loop;
}

.creation-loop li {
  position: relative;
  min-height: 190px;
  padding: 64px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: creation-loop;
}

.creation-loop li::before {
  position: absolute;
  top: 20px;
  left: 22px;
  color: var(--accent-strong);
  content: counter(creation-loop, decimal-leading-zero);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.creation-loop strong,
.creation-loop span {
  display: block;
}

.creation-loop span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.stage-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stage-card {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stage-card::before {
  display: block;
  width: 52px;
  height: 6px;
  margin-bottom: 52px;
  border-radius: 999px;
  background: var(--stage-color, var(--accent));
  content: "";
}

.stage-card[data-level="imitate"] { --stage-color: #4b7bec; }
.stage-card[data-level="modify"] { --stage-color: #8e63ce; }
.stage-card[data-level="transfer"] { --stage-color: #d18128; }
.stage-card[data-level="create"] { --stage-color: var(--accent); }

.stage-card > span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stage-card h3 {
  margin: 8px 0 12px;
  font-size: 1.2rem;
}

.stage-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.stage-card strong {
  display: block;
  margin-top: 24px;
  color: var(--accent-strong);
  font-size: 0.86rem;
}

.challenge-stage {
  margin-top: 46px;
}

.challenge-stage > header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.challenge-stage > header span {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.challenge-stage > header h3 {
  margin: 0;
  font-size: 1.4rem;
}

.challenge-grid {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
}

.challenge-grid a {
  display: grid;
  min-height: 128px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 5px 12px;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.challenge-grid a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.challenge-grid a > span {
  grid-row: 1 / span 2;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.challenge-grid a > strong {
  align-self: end;
}

.challenge-grid a > small {
  color: var(--muted);
  line-height: 1.55;
}

.challenge-grid .challenge-gate a {
  border-color: color-mix(in srgb, var(--highlight) 70%, var(--line));
  background: color-mix(in srgb, var(--surface) 88%, var(--highlight) 12%);
}

.challenge-grid .no-solution a::after {
  grid-column: 2;
  width: max-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: var(--accent-strong);
  content: "無完整解";
  font-size: 0.72rem;
  font-weight: 900;
}

/* Lesson Creation Challenge：把創作挑戰呈現成可執行的決策工作台。 */
.creation-challenge {
  --challenge-level-color: var(--accent);
  position: relative;
  overflow: hidden;
  margin: clamp(52px, 8vw, 96px) 0;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid color-mix(in srgb, var(--challenge-level-color) 38%, var(--line));
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 92%, var(--challenge-level-color) 8%);
  box-shadow: var(--shadow);
}

.creation-challenge::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: var(--challenge-level-color);
  content: "";
}

.creation-challenge[data-creation-level="imitate"] {
  --challenge-level-color: #4b7bec;
}

.creation-challenge[data-creation-level="modify"] {
  --challenge-level-color: #8e63ce;
}

.creation-challenge[data-creation-level="transfer"] {
  --challenge-level-color: #d18128;
}

.creation-challenge[data-creation-level="create"] {
  --challenge-level-color: var(--accent);
}

.creation-challenge__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.creation-challenge__heading h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(1.9rem, 4.2vw, 3.6rem);
  letter-spacing: -0.045em;
}

.creation-challenge__level {
  display: grid;
  min-width: 172px;
  flex: 0 0 auto;
  gap: 3px;
  margin: 4px 0 0;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--challenge-level-color) 42%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, var(--challenge-level-color) 14%);
  color: var(--challenge-level-color);
}

.creation-challenge__level span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.creation-challenge__level strong {
  font-size: 0.92rem;
  line-height: 1.45;
}

.creation-challenge__gate {
  display: inline-flex;
  width: max-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--highlight);
  color: #17201d;
  font-size: 0.72rem;
  font-weight: 900;
}

.creation-challenge__summary {
  max-width: 820px;
  margin: 24px 0 0;
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  font-weight: 800;
  line-height: 1.75;
}

.creation-challenge__purpose {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.creation-challenge__brief {
  margin-top: 30px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--challenge-level-color) 28%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, var(--challenge-level-color) 4%);
}

.creation-challenge__brief h3,
.creation-challenge__panel h3,
.creation-challenge__hints h3 {
  margin: 0 0 11px;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.creation-challenge__brief h3 {
  color: var(--challenge-level-color);
}

.creation-challenge__brief p {
  margin: 0;
  line-height: 1.8;
}

.creation-challenge__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.creation-challenge__panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--challenge-level-color);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, var(--challenge-level-color) 4%);
}

.creation-challenge__panel:nth-child(2) {
  border-top-color: var(--highlight);
}

.creation-challenge__list {
  margin: 0;
  padding-left: 1.25rem;
}

.creation-challenge__list li {
  line-height: 1.75;
}

.creation-challenge__list li + li {
  margin-top: 10px;
}

.creation-challenge__list li::marker {
  color: var(--challenge-level-color);
  font-weight: 900;
}

.creation-challenge__anti-copy {
  margin: 20px 0 0;
  padding: 15px 18px;
  border: 1px solid color-mix(in srgb, var(--highlight) 52%, var(--line));
  border-left: 4px solid var(--highlight);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 90%, var(--highlight) 10%);
  line-height: 1.75;
}

.creation-challenge__anti-copy strong,
.creation-challenge__solution-policy strong,
.creation-challenge__solution-note strong {
  color: var(--accent-strong);
}

.creation-challenge__hints {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.creation-challenge__hints h3 {
  color: var(--accent-strong);
}

.creation-challenge__hint {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 95%, var(--accent) 5%);
}

.creation-challenge__hint + .creation-challenge__hint {
  margin-top: 8px;
}

.creation-challenge__hint summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 11px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.creation-challenge__hint summary::-webkit-details-marker {
  display: none;
}

.creation-challenge__hint summary::before {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-strong);
  content: "+";
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1;
}

.creation-challenge__hint[open] summary {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.creation-challenge__hint[open] summary::before {
  content: "−";
}

.creation-challenge__hint p {
  margin: 0;
  padding: 0 15px 15px 47px;
  color: var(--muted);
  line-height: 1.75;
}

.creation-challenge__solution-policy,
.creation-challenge__solution-note {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.creation-challenge__solution-note {
  margin-top: 8px;
}

.creation-challenge__path-link {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.creation-challenge__path-link a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 900;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.creation-challenge__path-link a:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  transform: translateY(-2px);
}

.requirement-flow {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.requirement-flow li {
  display: grid;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
}

.requirement-flow li > span {
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.requirement-flow strong {
  font-size: 1.08rem;
}

.requirement-flow p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.requirement-template {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.requirement-template p {
  margin: 8px 0 0;
  font-size: 1.05rem;
}

.rubric-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.creation-rubric {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.creation-rubric th,
.creation-rubric td {
  padding: 17px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.creation-rubric th:last-child,
.creation-rubric td:last-child {
  border-right: 0;
}

.creation-rubric tbody tr:last-child th,
.creation-rubric tbody tr:last-child td {
  border-bottom: 0;
}

.creation-rubric thead th,
.creation-rubric tbody th {
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
  color: var(--accent-strong);
}

.creation-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 72px 0;
  padding: clamp(28px, 5vw, 52px);
  border-radius: 24px;
  background: var(--text);
  color: var(--bg);
}

.creation-cta h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  letter-spacing: -0.04em;
}

.creation-cta p:not(.eyebrow) {
  max-width: 700px;
  margin: 14px 0 0;
  opacity: 0.78;
}

.creation-cta > a {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--highlight);
  color: #17201d;
  font-weight: 900;
  text-decoration: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px max(24px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer a {
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 820px) {
  .pc-starter-download {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .pc-starter-download__button {
    width: 100%;
  }

  .site-header,
  .section-heading--row,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    position: static;
  }

  .header-actions {
    width: 100%;
    overflow-x: auto;
  }

  .header-actions > * {
    flex: 0 0 auto;
  }

  .principle-grid,
  .course-grid,
  .challenge-grid,
  .creation-challenge__grid {
    grid-template-columns: 1fr;
  }

  .chapter-quickstart {
    grid-template-columns: 1fr;
  }

  .chapter-quickstart__steps,
  .tool-map dl,
  .practice-preflight ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creation-challenge__heading {
    flex-direction: column;
    gap: 16px;
  }

  .creation-challenge__level {
    min-width: 0;
    margin-top: 0;
  }

  .creation-path-banner,
  .stage-map,
  .creation-loop,
  .requirement-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creation-path-banner > a {
    min-height: 112px;
  }

  .creation-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  #core-ideas .core-idea-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pc-flow,
  .pc-stage-nav__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pc-flow__step::after {
    display: none;
  }
}

@media (max-width: 540px) {
  main {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    padding: 12px 14px;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding-top: 52px;
  }

  .hero__stats div {
    min-width: 0;
    flex: 1 1 120px;
    border-radius: 14px;
  }

  .chapter-quickstart {
    margin-bottom: 0;
    padding: 22px 18px;
    border-radius: 18px;
  }

  .chapter-quickstart__steps,
  .tool-map dl,
  .practice-preflight ul {
    grid-template-columns: 1fr;
  }

  .tool-map {
    padding: 18px;
  }

  .principles,
  .course-section {
    padding: 60px 0;
  }

  .creation-path-banner {
    margin-top: 28px;
  }

  .creation-path-banner,
  .stage-map,
  .creation-loop,
  .requirement-flow {
    grid-template-columns: 1fr;
  }

  .creation-loop li,
  .stage-card,
  .requirement-flow li {
    min-height: 0;
  }

  .creation-challenge {
    margin: 44px 0;
    padding: 28px 18px;
    border-radius: 22px;
  }

  .creation-challenge__heading h2 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .creation-challenge__summary {
    margin-top: 20px;
    font-size: 1.05rem;
  }

  .creation-challenge__brief,
  .creation-challenge__panel {
    padding: 18px;
  }

  .challenge-stage > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .challenge-grid a {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .creation-cta {
    margin: 48px 0;
  }

  .creation-challenge__hint summary {
    padding: 10px 12px;
  }

  .creation-challenge__hint p {
    padding: 0 12px 13px 44px;
  }

  .creation-challenge__path-link a {
    width: 100%;
    justify-content: center;
  }

  #scope .course-note {
    margin-top: 18px;
    padding: 14px;
  }

  #core-ideas .core-idea-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #core-ideas .core-idea-grid li {
    min-height: 0;
    padding: 62px 18px 18px;
  }

  #core-ideas .core-idea-grid li::before {
    top: 18px;
    left: 18px;
  }

  #core-ideas .core-idea-grid li::after {
    top: 47px;
    left: 18px;
  }

  #debugging .debug-scenario {
    margin-bottom: 24px;
    padding: 16px 18px;
  }

  #debugging .debug-timeline li {
    min-height: 62px;
    padding-left: 52px;
    padding-bottom: 22px;
  }

  #debugging .debug-timeline li:last-child {
    min-height: 38px;
  }

  #debugging .debug-timeline li::before {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 0.74rem;
  }

  #debugging .debug-timeline li:not(:last-child)::after {
    top: 43px;
    left: 18px;
  }

  .evidence-checklist__meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .evidence-checklist__item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    min-height: 64px;
    padding: 14px;
  }

  .evidence-checklist__mark {
    width: 28px;
    height: 28px;
  }

  .evidence-checklist__copy {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px 8px;
  }

  .evidence-checklist__state {
    grid-column: 2;
    justify-self: start;
  }

  .pc-flow,
  .pc-stage-nav__steps,
  .pc-stage-pager {
    grid-template-columns: 1fr;
  }

  .pc-flow__link {
    min-height: 0;
  }

  .pc-stage-nav,
  .pc-stage-pager {
    width: min(100% - 20px, 1180px);
  }

  .pc-stage-nav {
    padding: 12px;
  }

  .pc-stage-nav__meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .pc-stage-nav__current {
    padding: 0 12px 6px;
  }

  .pc-stage-pager__link--next {
    align-items: flex-start;
    text-align: left;
  }

  .pc-doc {
    width: min(100% - 28px, 980px);
    padding-top: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
