:root {
  color-scheme: light;
  --focus-ring: #b97500;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #17212b;
  background: #f4f1e8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

.page-shell {
  display: grid;
  min-width: 0;
  min-height: 100vh;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.card {
  width: min(100%, 46rem);
  min-width: 0;
  padding: clamp(1.4rem, 5vw, 3rem);
  border: 1px solid #d6d0c3;
  border-radius: 1rem;
  background: #fffdf8;
  box-shadow: 0 1rem 2.5rem rgb(29 39 51 / 8%);
}

.eyebrow,
.progress {
  margin: 0 0 0.6rem;
  color: #76521d;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.programmatic-focus-heading:focus {
  outline: none;
  text-decoration-line: underline;
  text-decoration-color: var(--focus-ring);
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.6rem);
}

.question-heading {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(1.35rem, 4vw, 1.8rem);
}

h3 {
  font-size: clamp(1.15rem, 3vw, 1.4rem);
}

p {
  max-width: 65ch;
}

.subtitle {
  margin-top: 0.55rem;
  color: #425364;
  font-size: 1.15rem;
  font-weight: 650;
}

.quiz-reference {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d6d0c3;
}

.opening-quote {
  margin: 1.75rem 0;
  padding-left: 1.1rem;
  border-left: 4px solid #d88a2d;
  color: #354555;
  font-size: 1.1rem;
}

.opening-quote p {
  margin-bottom: 0.3rem;
}

.opening-quote footer {
  font-size: 0.9rem;
  font-weight: 700;
}

.prose > p + p {
  margin-top: 1rem;
}

.question-image {
  display: block;
  width: 100%;
  max-height: 24rem;
  margin: 1.35rem 0;
  border-radius: 0.75rem;
  object-fit: contain;
}

.card,
.prose,
.choice,
.review-choice,
.source-note,
.status {
  overflow-wrap: anywhere;
}

.choices {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  margin: 1.5rem 0 0;
  padding: 0;
  border: 0;
}

.choice {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.75rem;
  border: 2px solid #c9c4b9;
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
}

.choice:hover {
  border-color: #76521d;
}

.choice:has(input:checked) {
  border-color: #263a4d;
  box-shadow: 0 0 0 2px #263a4d;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
}

.choice-letter {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #263a4d;
  font-weight: 800;
}

.choice-correct {
  border-color: #267244;
  background: #edf8f0;
}

.choice-correct::after {
  content: "Correct";
  grid-column: 2 / -1;
  color: #185630;
  font-weight: 800;
}

.choice-incorrect {
  border-color: #a34135;
  background: #fff1ef;
}

.choice-incorrect::after {
  content: "Your answer";
  grid-column: 2 / -1;
  color: #7d2e26;
  font-weight: 800;
}

.feedback {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d6d0c3;
}

.source-note {
  color: #526170;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  margin-top: 1.5rem;
}

.button,
.text-link {
  display: inline-block;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.button {
  border: 2px solid #263a4d;
  color: #fff;
  background: #263a4d;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  background: #172737;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.text-link {
  color: #263a4d;
}

.button:focus-visible,
.text-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.status {
  margin: 1.5rem 0 0;
  color: #526170;
  font-size: 0.9rem;
}

.privacy-note {
  margin-top: 2rem;
  padding: 1rem;
  border-left: 4px solid #d88a2d;
  background: #f8f4e9;
}

.privacy-note h2 {
  font-size: 1.1rem;
}

.privacy-note p,
.share-status {
  margin-bottom: 0;
}

.review-shell,
.sources-shell {
  place-items: start center;
}

.review-page {
  width: min(100%, 52rem);
  min-width: 0;
}

.result-summary {
  margin-bottom: 2rem;
}

.score {
  margin: 1.5rem 0 0;
  color: #263a4d;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
}

.score strong {
  font-size: clamp(3.5rem, 12vw, 6rem);
  line-height: 1;
}

.result-facts {
  margin: 1.5rem 0;
}

.result-facts div {
  padding: 1rem;
  border-radius: 0.65rem;
  background: #f4f1e8;
}

.result-facts dt {
  color: #526170;
  font-weight: 700;
}

.result-facts dd {
  margin: 0.25rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.comparison {
  font-size: 1.1rem;
  font-weight: 700;
}

.closing {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #d6d0c3;
}

.review-section > h2 {
  margin-bottom: 1rem;
}

.review-list {
  display: grid;
  min-width: 0;
  gap: 1.25rem;
}

.review-item h3 {
  margin-top: 0;
}

.review-choices {
  display: grid;
  gap: 0.6rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.review-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.75rem;
  border: 2px solid #d6d0c3;
  border-radius: 0.65rem;
  background: #fff;
}

.review-choice-correct {
  border-color: #267244;
  background: #edf8f0;
}

.review-choice-incorrect {
  border-color: #a34135;
  background: #fff1ef;
}

.review-choice-state {
  grid-column: 2;
  font-size: 0.9rem;
}

.correct-text {
  color: #185630;
}

.incorrect-text {
  color: #7d2e26;
}

.review-outcome {
  font-weight: 800;
}

.question-context,
.evidence-list {
  margin: 1rem 0;
}

.evidence-list {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

.evidence {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border-left: 4px solid #d88a2d;
  border-radius: 0.4rem;
  background: #f8f4e9;
}

.evidence img {
  display: block;
  max-width: 100%;
  height: auto;
}

.timeline-date,
.image-credit {
  color: #526170;
  font-size: 0.9rem;
  font-weight: 700;
}

.breadcrumb {
  padding: 0.75rem;
  border-radius: 0.4rem;
  background: #edf8f0;
}

.sources-page {
  width: min(100%, 52rem);
}

.sources-page h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d6d0c3;
}

.sources-page h3 {
  margin-top: 1.5rem;
}

.sources-page li + li {
  margin-top: 0.45rem;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 34rem) {
  .page-shell {
    align-items: start;
    padding: 0;
  }

  .card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .review-list {
    gap: 0;
  }

  .review-item,
  .result-summary,
  .sources-page {
    border-bottom: 1px solid #d6d0c3;
  }

  .review-item {
    min-height: auto;
  }

  .button {
    width: 100%;
  }
}

@media (max-width: 30rem) {
  .quiz-card .question-heading {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
