:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #5e6764;
  --paper: #f7f4ed;
  --panel: #fffdf8;
  --line: #d9d1c2;
  --green: #235c4a;
  --green-2: #dbe8df;
  --blue: #285f8f;
  --blue-2: #dbe8f5;
  --red: #9e3f31;
  --red-2: #f2dfd9;
  --amber: #b7822e;
  --amber-2: #f3e6c8;
  --violet: #594f7c;
  --shadow: 0 18px 50px rgba(38, 33, 24, 0.12);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74), rgba(247,244,237,0.96)),
    repeating-linear-gradient(90deg, rgba(35,92,74,0.05) 0 1px, transparent 1px 80px),
    var(--paper);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
  background: rgba(247, 244, 237, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fffdf8;
  background: var(--green);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 8px;
}

.topnav a,
.primary-action,
.secondary-action,
.module-tab,
.chapter-button,
.quiz-option {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(23, 33, 29, 0.14);
}

.topnav a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
}

.topnav a:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.82);
}

main {
  overflow: hidden;
}

.overview,
.roadmap-section,
.chapters-section,
.quiz-section {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(22px, 5vw, 68px);
  min-height: calc(100vh - 72px);
  padding: 54px 0 42px;
}

.overview-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4.8vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  letter-spacing: 0;
}

.lead {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.8;
}

.hero-actions,
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  cursor: pointer;
}

.primary-action {
  border-color: var(--green);
  color: #fffdf8;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(35, 92, 74, 0.2);
}

.secondary-action {
  color: var(--ink);
  background: #fffdf8;
}

.hero-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chain-card {
  min-height: 180px;
  padding: 22px;
  border: 1px solid rgba(23, 33, 29, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.chain-card span,
.module-label,
.chapter-number {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chain-card strong {
  display: block;
  margin: 12px 0 10px;
  font-size: 24px;
}

.chain-card p {
  color: var(--muted);
  line-height: 1.65;
}

.chain-card.is-large {
  grid-row: span 2;
  min-height: 372px;
  color: #fffdf8;
  background:
    linear-gradient(180deg, rgba(23,33,29,0.12), rgba(23,33,29,0.74)),
    url("assets/chapter-images/ch11.png") center / cover;
}

.chain-card.is-large span,
.chain-card.is-large p {
  color: rgba(255, 253, 248, 0.82);
}

.chain-card.is-large strong {
  margin-top: 170px;
}

.chain-card.is-accent {
  color: #fffdf8;
  background: var(--red);
}

.chain-card.is-accent span,
.chain-card.is-accent p {
  color: rgba(255, 253, 248, 0.82);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 26px;
  text-align: center;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.roadmap-section,
.chapters-section,
.quiz-section {
  padding: 84px 0;
}

.module-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scrollbar-width: thin;
}

.module-tab {
  flex: 0 0 auto;
  padding: 0 16px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.86);
  cursor: pointer;
}

.module-tab.is-active {
  color: #fffdf8;
  border-color: var(--green);
  background: var(--green);
}

.roadmap {
  position: relative;
  display: grid;
  gap: 16px;
}

.module-row {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.module-row::before {
  content: "";
  position: absolute;
  left: 248px;
  top: 42px;
  bottom: -18px;
  width: 2px;
  background: var(--line);
}

.module-row:last-child::before {
  display: none;
}

.module-card,
.route-card,
.chapter-detail,
.chapter-index,
.quiz-card {
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 12px 30px rgba(38, 33, 24, 0.08);
}

.module-card {
  padding: 20px;
}

.module-card h3 {
  margin: 8px 0 10px;
  font-size: 22px;
}

.module-card p,
.route-card p,
.chapter-summary,
.chapter-list li,
.quiz-feedback {
  color: var(--muted);
  line-height: 1.72;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.route-card {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  cursor: pointer;
}

.route-card img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
  filter: saturate(0.95) contrast(1.02);
}

.route-card-body {
  padding: 16px;
}

.route-card h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

.route-card p {
  margin-bottom: 12px;
  font-size: 14px;
}

.route-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--ink);
  background: var(--amber-2);
  font-size: 12px;
  font-weight: 700;
}

.chapter-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.chapter-index {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 16px;
}

.aside-title {
  padding: 6px 4px 14px;
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
}

.aside-title span,
.chapter-kicker {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.aside-title strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.chapter-buttons {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.chapter-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: #fffdf8;
  cursor: pointer;
}

.chapter-button span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #fffdf8;
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.chapter-button strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.chapter-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.chapter-button.is-active {
  border-color: var(--green);
  background: var(--green-2);
}

.chapter-detail {
  min-height: 620px;
  overflow: hidden;
}

.detail-media {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 0;
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
}

.detail-media img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  background: #ece5d8;
}

.detail-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 4vw, 42px);
  background: #fffdf8;
}

.detail-head h2 {
  font-size: clamp(29px, 4vw, 46px);
}

.chapter-summary,
.chapter-tip {
  font-size: 17px;
}

.chapter-tip {
  margin-bottom: 0;
  color: var(--green);
  line-height: 1.7;
}

.detail-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
}

.detail-block {
  min-width: 0;
}

.detail-block h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.slide-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(23, 33, 29, 0.1);
  background: #ece5d8;
}

.slide-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
  background: rgba(255, 253, 248, 0.96);
}

.slide-nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(23, 33, 29, 0.16);
  border-radius: 8px;
  color: #fffdf8;
  background: var(--green);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.slide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.slide-meta strong {
  color: var(--ink);
}

.canvas-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(45deg, rgba(23, 33, 29, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 33, 29, 0.04) 25%, transparent 25%),
    #efe9dd;
  background-size: 18px 18px;
}

.chapter-canvas {
  display: block;
  max-width: none;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.slide-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  min-width: 190px;
  max-width: calc(100% - 28px);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 24px rgba(38, 33, 24, 0.14);
  text-align: center;
  font-weight: 800;
}

.slide-status.is-visible {
  display: block;
}

.slide-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(23, 33, 29, 0.15);
  border-radius: 7px;
  color: #fffdf8;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.pdf-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(23, 33, 29, 0.15);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.knowledge-list {
  display: grid;
  gap: 10px;
}

.knowledge-jump {
  display: block;
  width: 100%;
  min-height: 108px;
  padding: 13px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.knowledge-jump:hover,
.knowledge-jump.is-active {
  border-color: var(--green);
  background: var(--green-2);
  transform: translateY(-1px);
}

.knowledge-topline {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.knowledge-topline strong {
  font-size: 16px;
  line-height: 1.35;
}

.knowledge-jump > span:last-child {
  display: block;
  color: var(--muted);
  line-height: 1.65;
}

.chapter-list {
  margin: 0;
  padding-left: 18px;
}

.chapter-list li + li {
  margin-top: 8px;
}

.quiz-card {
  max-width: 850px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.quiz-progress {
  height: 8px;
  margin: 12px 0 24px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(23, 33, 29, 0.09);
}

.quiz-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
}

#quizQuestion {
  min-height: 72px;
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.32;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #fffdf8;
  cursor: pointer;
}

.quiz-option .letter {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: #fffdf8;
  background: var(--violet);
  font-weight: 800;
}

.quiz-option.is-correct {
  border-color: var(--green);
  background: var(--green-2);
}

.quiz-option.is-wrong {
  border-color: var(--red);
  background: var(--red-2);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-feedback {
  min-height: 58px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(40, 95, 143, 0.09);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px clamp(18px, 4vw, 44px);
  color: var(--muted);
  border-top: 1px solid rgba(23, 33, 29, 0.1);
}

@media (max-width: 980px) {
  .overview,
  .module-row,
  .chapter-shell,
  .detail-media {
    grid-template-columns: 1fr;
  }

  .overview {
    min-height: auto;
  }

  .module-row::before {
    display: none;
  }

  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-index {
    position: static;
    max-height: none;
  }

  .chapter-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .slide-viewer {
    border-right: 0;
    border-bottom: 1px solid rgba(23, 33, 29, 0.1);
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
  }

  .topnav a {
    flex: 1;
    justify-content: center;
  }

  .hero-board,
  .route-grid,
  .chapter-buttons {
    grid-template-columns: 1fr;
  }

  .chain-card.is-large {
    min-height: 250px;
  }

  .chain-card.is-large strong {
    margin-top: 74px;
  }

  .slide-meta {
    display: grid;
    gap: 2px;
  }
}
