:root {
  --bg: #f4efe3;
  --surface: rgba(255, 252, 245, 0.9);
  --surface-strong: #fffaf0;
  --ink: #1f1d1a;
  --muted: #5f5646;
  --line: rgba(76, 63, 40, 0.16);
  --accent: #c75c2d;
  --accent-deep: #8d3511;
  --accent-soft: #f1c4a3;
  --ok: #1f7a4c;
  --warn: #b86b00;
  --shadow: 0 18px 40px rgba(70, 45, 12, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(199, 92, 45, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(210, 180, 108, 0.18), transparent 24%),
    linear-gradient(180deg, #efe7d6 0%, var(--bg) 55%, #ece4d4 100%);
  font-family: Georgia, "Times New Roman", serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.panel,
.card,
.chapter-card,
.question-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero,
.panel {
  background: var(--surface);
  border-radius: 28px;
  padding: 28px;
  backdrop-filter: blur(12px);
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(199, 92, 45, 0.28), transparent 65%);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-deep);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.95;
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.lede,
.panel-copy,
.bullet-list,
.quiz-form label,
.chapter-status,
.meta-label {
  color: var(--muted);
}

.lede {
  max-width: 52ch;
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-meta > div,
.score-badge,
.link-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.meta-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel {
  margin-top: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.chapter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.chapter-list,
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.chapter-card {
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.95), rgba(245, 237, 220, 0.94));
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.chapter-card:hover,
.chapter-card.active {
  transform: translateY(-2px);
  border-color: rgba(141, 53, 17, 0.4);
}

.chapter-card.completed {
  border-color: rgba(31, 122, 76, 0.35);
  background: linear-gradient(180deg, rgba(246, 255, 248, 0.96), rgba(233, 248, 237, 0.94));
}

.chapter-order {
  display: block;
  margin-bottom: 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
}

.chapter-name {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.88);
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.hidden {
  display: none;
}

.link-chip {
  color: var(--accent-deep);
  text-decoration: none;
  align-self: center;
}

.quiz-panel {
  margin-top: 18px;
}

.quiz-form {
  display: grid;
  gap: 14px;
}

.question-card {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.92);
}

.question-card legend {
  font-weight: 700;
  margin-bottom: 12px;
  padding: 0 6px;
}

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

.option-list label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(241, 196, 163, 0.18);
  border: 1px solid transparent;
}

.option-list label.option-correct {
  border-color: rgba(31, 122, 76, 0.35);
  background: rgba(31, 122, 76, 0.12);
}

.option-list label.option-correct-selected {
  border-color: rgba(31, 122, 76, 0.45);
  background: rgba(31, 122, 76, 0.18);
}

.option-list label.option-wrong-selected {
  border-color: rgba(178, 54, 32, 0.45);
  background: rgba(178, 54, 32, 0.14);
}

.question-feedback {
  margin: 14px 0 0;
  font-size: 0.94rem;
  font-weight: 700;
}

.question-feedback.pending {
  color: var(--muted);
}

.question-feedback.correct {
  color: var(--ok);
}

.question-feedback.wrong {
  color: #b23620;
}

.quiz-actions {
  margin-top: 18px;
}

.primary {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff8f1;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 20px;
  background: rgba(255, 250, 240, 0.92);
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.score-badge.pass {
  color: var(--ok);
}

.score-badge.fail {
  color: var(--warn);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .panel-head {
    flex-direction: column;
  }
}
