:root {
  color-scheme: light dark;
  --ink: #14201c;
  --muted: #60706a;
  --paper: #fbfcf8;
  --surface: #ffffff;
  --surface-soft: #f0f4ee;
  --line: #d9e1dc;
  --forest: #173f33;
  --forest-dark: #102d25;
  --lime: #d7f55b;
  --lime-soft: #f2facb;
  --correct: #16714b;
  --correct-bg: #eaf7f0;
  --wrong: #b53a31;
  --wrong-bg: #fff0ed;
  --focus: #2563eb;
  --shadow: 0 18px 60px rgba(22, 47, 38, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 0%, rgba(215, 245, 91, 0.2), transparent 25rem),
    var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

button, input { font: inherit; }

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

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: .7rem 1rem;
  border-radius: .6rem;
  background: var(--ink);
  color: white;
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(217, 225, 220, .75);
  background: rgba(251, 252, 248, .88);
  backdrop-filter: blur(18px);
}

.header-inner,
main,
footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.language-picker { position: relative; }

.language-picker select {
  min-height: 46px;
  padding: .65rem 2.1rem .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.language-picker select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--forest);
  color: var(--lime);
  font-size: 1.2rem;
  font-weight: 900;
}

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

.brand strong { line-height: 1.2; }
.brand small { color: var(--muted); font-size: .77rem; margin-top: .15rem; }

main { padding-block: clamp(2.5rem, 7vw, 5.5rem) 4rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--forest);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1, h2, p { overflow-wrap: break-word; }

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero-copy {
  max-width: 700px;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: .55rem;
}

.hero-stats div {
  min-width: 86px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .74);
  text-align: center;
}

.hero-stats strong,
.hero-stats span { display: block; }
.hero-stats strong { font-size: 1.45rem; line-height: 1; }
.hero-stats span { margin-top: .4rem; color: var(--muted); font-size: .72rem; text-transform: uppercase; }

.instructions {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid #dce99d;
  border-radius: 1rem;
  background: var(--lime-soft);
}

.instructions p { margin: 0; }

.instruction-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-weight: 900;
}

.question-list { display: grid; gap: 1.25rem; }

.question-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.question-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.45rem 1rem;
}

.question-number {
  margin: 0 0 .2rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.question-topic { margin: 0; font-size: clamp(1.15rem, 3vw, 1.45rem); line-height: 1.25; }
.question-prompt { margin: 0; padding: 0 1.45rem 1.2rem; color: var(--muted); }

.question-status {
  flex: 0 0 auto;
  padding: .36rem .65rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
}

.question-status.correct { background: var(--correct-bg); color: var(--correct); }
.question-status.wrong { background: var(--wrong-bg); color: var(--wrong); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

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

.statement {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .9rem;
  padding: 1rem 1.45rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s ease;
}

.statement:last-child { border-bottom: 0; }
.statement:hover { background: var(--surface-soft); }

.statement input {
  appearance: none;
  display: grid;
  place-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: .16rem 0 0;
  border: 2px solid #93a39c;
  border-radius: .38rem;
  background: white;
}

.statement input::before {
  content: "";
  width: .68rem;
  height: .68rem;
  border-radius: .18rem;
  background: var(--forest);
  transform: scale(0);
  transition: transform .12s ease;
}

.statement input:checked { border-color: var(--forest); }
.statement input:checked::before { transform: scale(1); }
.statement input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.statement-body { min-width: 0; }
.statement-text { display: block; }

.feedback {
  display: none;
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px dashed currentColor;
  font-size: .92rem;
}

.feedback strong { display: block; margin-bottom: .18rem; }

.statement.is-correct-answer { background: var(--correct-bg); color: #12583d; }
.statement.is-wrong-answer { background: var(--wrong-bg); color: #852b25; }
.statement.is-reviewed .feedback { display: block; }
.statement input:disabled { opacity: 1; }

.question-summary {
  padding: 1rem 1.45rem;
  border-top: 1px solid var(--line);
  background: #fafbf8;
  color: var(--muted);
  font-size: .92rem;
}

.question-summary strong { color: var(--ink); }

.quiz-actions {
  position: sticky;
  bottom: 1rem;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: .75rem;
  width: fit-content;
  margin: 1.5rem auto 0;
  padding: .55rem;
  border: 1px solid rgba(217, 225, 220, .9);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 40px rgba(22, 47, 38, .16);
  backdrop-filter: blur(15px);
}

.button {
  min-height: 46px;
  padding: .7rem 1.05rem;
  border: 1px solid transparent;
  border-radius: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.button-primary { background: var(--forest); color: white; }
.button-primary:hover { background: var(--forest-dark); }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-secondary:hover, .button-quiet:hover { background: var(--surface-soft); }
.button-quiet { border-color: var(--line); background: transparent; color: var(--forest); }

.results {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1.35rem;
  border-radius: 1.3rem;
  background: var(--forest);
  color: white;
}

.results[hidden] { display: none; }
.results .eyebrow, .results p { color: #d9e8e2; }
.results h2, .results p { margin: 0; }
.results h2 { font-size: 1.45rem; }
.results .button-primary { background: var(--lime); color: var(--forest-dark); }

.score-ring {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 5px solid rgba(215, 245, 91, .25);
  border-top-color: var(--lime);
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 900;
}

footer { padding-block: 0 2rem; color: var(--muted); font-size: .85rem; text-align: center; }
footer p { margin: .3rem 0; }
footer .credit { color: var(--ink); }
footer .credit a {
  color: var(--forest);
  font-weight: 800;
  text-underline-offset: .2em;
}
footer .credit a:hover { text-decoration-thickness: .14em; }
footer .credit a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .2rem; }
.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; }

@media (max-width: 760px) {
  .header-inner, main, footer { width: min(100% - 1.25rem, 1120px); }
  .header-inner { min-height: 64px; }
  .brand strong { font-size: .88rem; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  main { padding-top: 2.2rem; }
  .hero { grid-template-columns: 1fr; gap: 1.4rem; }
  .hero-stats { width: 100%; }
  .hero-stats div { min-width: 0; padding: .8rem .35rem; }
  .instructions { align-items: flex-start; }
  .question-heading, .question-prompt, .statement, .question-summary { padding-left: 1rem; padding-right: 1rem; }
  .results { grid-template-columns: auto 1fr; }
  .results .button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 460px) {
  h1 { font-size: clamp(2.15rem, 12vw, 3.1rem); }
  .button-quiet { padding-inline: .7rem; font-size: .8rem; }
  .language-picker select { width: 64px; padding-right: .35rem; padding-left: .45rem; font-size: .78rem; }
  .question-heading { flex-direction: column; gap: .7rem; }
  .statement { gap: .72rem; }
  .quiz-actions { width: calc(100% - .5rem); }
  .quiz-actions .button { flex: 1 1 0; padding-inline: .55rem; font-size: .9rem; }
  .results { grid-template-columns: 1fr; text-align: center; }
  .score-ring { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #ecf5f1;
    --muted: #a8bbb3;
    --paper: #0d1713;
    --surface: #14231d;
    --surface-soft: #1a2d25;
    --line: #2b4238;
    --forest: #215b49;
    --forest-dark: #184638;
    --lime-soft: #263513;
    --correct-bg: #153b2b;
    --wrong-bg: #48211f;
    --correct: #75dca6;
    --wrong: #ff9d94;
    --shadow: 0 18px 60px rgba(0, 0, 0, .24);
  }
  body { background: radial-gradient(circle at 92% 0%, rgba(215, 245, 91, .09), transparent 25rem), var(--paper); }
  .site-header { background: rgba(13, 23, 19, .88); }
  .hero-stats div, .quiz-actions { background: rgba(20, 35, 29, .88); }
  .statement input { background: #0d1713; }
  .statement.is-correct-answer { color: #bcebd1; }
  .statement.is-wrong-answer { color: #ffc3bd; }
  .question-summary { background: #101d18; }
  .button-secondary { background: var(--surface); color: var(--ink); }
}
