:root {
  --ink: #17202a;
  --muted: #5b6776;
  --paper: #fffdf8;
  --wash: #f3efe4;
  --line: #d8d0bf;
  --accent: #265f73;
  --accent-2: #8c4f24;
  --good: #1f7a4d;
  --bad: #9a2f2f;
  --code: #f6ead8;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #f8f3e8 70%, #efe7d7);
  font-size: 18px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 24px 60px rgba(36, 28, 16, 0.08);
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: -0.055em;
}

h2 {
  margin-top: 2.4rem;
  font-size: clamp(1.65rem, 4vw, 2.3rem);
  letter-spacing: -0.035em;
}

h3 {
  margin-top: 1.6rem;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.lede {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
}

.course-nav,
.callout,
.quiz,
.reference-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.74);
}

.course-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 18px 0 32px;
  padding: 14px 18px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.course-nav a {
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 22px 0;
}

.card,
.reference-card {
  padding: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.58);
}

.card h3,
.reference-card h3 {
  margin-top: 0;
}

.callout {
  margin: 24px 0;
  padding: 22px 24px;
  border-left: 6px solid var(--accent);
}

.callout strong {
  color: var(--accent-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.96rem;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--accent-2);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

code,
.tag {
  border-radius: 999px;
  background: var(--code);
  padding: 0.12em 0.48em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
}

.tag {
  display: inline-block;
  margin: 0 0.2em 0.2em 0;
  color: #5c3317;
}

.quiz {
  margin: 28px 0;
  padding: 24px;
}

.quiz label {
  display: block;
  margin: 18px 0 6px;
  font-weight: 700;
}

.quiz input {
  width: min(260px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
}

.quiz button {
  margin-top: 18px;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
}

.feedback {
  min-height: 1.5em;
  margin: 6px 0 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

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

.feedback.incorrect {
  color: var(--bad);
}

.source-list li {
  margin: 0.65em 0;
}

.print-note {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .page {
    width: min(100% - 22px, 980px);
    padding-top: 16px;
  }

  .hero {
    padding: 26px;
    border-radius: 22px;
  }

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

  table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  body {
    background: white;
    font-size: 12pt;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .hero,
  .course-nav,
  .card,
  .callout,
  .quiz,
  .reference-card {
    box-shadow: none;
    background: white;
  }

  .quiz button {
    display: none;
  }
}
