:root {
  --primary: #111111;
  --primary-active: #242424;
  --ink: #111111;
  --body: #374151;
  --muted: #6b7280;
  --hairline: #e5e7eb;
  --hairline-soft: #f3f4f6;
  --canvas: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-card: #f5f5f5;
  --surface-strong: #e5e7eb;
  --dark: #101010;
  --dark-elevated: #1a1a1a;
  --blue: #3b82f6;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --warning: #f59e0b;
  --display: "Cal Sans", "Inter", sans-serif;
  --sans: "Inter", sans-serif;
  --shadow: 0 18px 45px rgba(17, 17, 17, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--body);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

button, select, input { font: inherit; }
a { color: inherit; }

.shell {
  display: flex;
  flex-direction: column;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 12px 0 0;
}

.site-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline-soft);
}

.wordmark {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.wordmark__badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--canvas);
  background: var(--primary);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-size: 14px; font-weight: 700; letter-spacing: -0.025em; }
.wordmark small { margin-top: 1px; color: var(--muted); font-size: 11px; }

.site-header__link {
  padding: 9px 13px;
  color: var(--ink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.site-header__link:hover { background: var(--surface-soft); }
.site-header__link span { margin-left: 4px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 68px;
  align-items: center;
  padding: 92px 8.5% 80px;
  border-bottom: 1px solid var(--hairline-soft);
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 19px;
  padding: 5px 10px;
  color: #4b5563;
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1, h2, h3 { color: var(--ink); font-family: var(--display); }

h1 {
  max-width: 710px;
  margin: 0;
  font-size: clamp(45px, 5.5vw, 68px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1.04;
  text-wrap: balance;
}

.lead {
  max-width: 650px;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.score-card {
  display: grid;
  gap: 9px;
  align-content: center;
  min-height: 208px;
  padding: 28px;
  color: var(--ink);
  background: var(--surface-card);
  border-radius: 16px;
}

.score-card::before {
  width: 36px;
  height: 4px;
  margin-bottom: 6px;
  background: var(--primary);
  border-radius: 999px;
  content: "";
}

.score-card strong {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1;
}

.score-card__label, .score-card span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 38px 0 18px;
  padding: 20px 22px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.toolbar__title {
  width: 100%;
  margin: 0 0 3px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

select {
  min-width: 255px;
  height: 40px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.check {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.check input { width: 16px; height: 16px; accent-color: var(--primary); }

button {
  min-height: 40px;
  padding: 0 17px;
  cursor: pointer;
  color: var(--canvas);
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover:not(:disabled) { background: var(--primary-active); border-color: var(--primary-active); transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

button.ghost { color: var(--ink); background: transparent; border-color: var(--hairline); }
button.ghost:hover:not(:disabled) { background: var(--canvas); border-color: #9ca3af; }

.quiz {
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.progress { height: 5px; background: var(--hairline-soft); }
#progressBar { width: 0; height: 100%; background: var(--primary); transition: width 180ms ease; }

.question { padding: 48px 52px; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.meta span:first-child { padding: 4px 8px; color: var(--ink); background: var(--surface-soft); border-radius: 6px; }

.question h2 {
  max-width: 900px;
  margin: 0 0 32px;
  font-size: clamp(28px, 3.6vw, 43px);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.13;
}

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

.option {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
}

.option:hover:not(:disabled) { background: var(--surface-soft); border-color: #9ca3af; }

.letter {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}

.option.correct { color: #065f46; background: var(--green-soft); border-color: #6ee7b7; }
.option.correct .letter { color: var(--canvas); background: var(--green); }
.option.wrong { color: #991b1b; background: var(--red-soft); border-color: #fecaca; }
.option.wrong .letter { color: var(--canvas); background: var(--red); }

.feedback {
  margin-top: 20px;
  padding: 14px 16px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.results {
  margin-top: 20px;
  padding: 36px 42px;
  color: var(--canvas);
  background: var(--dark);
  border-radius: 12px;
}

.results h2 { margin: 0 0 7px; color: var(--canvas); font-size: 36px; letter-spacing: -0.05em; }
.results p { max-width: 680px; margin: 0 0 20px; color: #d1d5db; font-size: 16px; }
.results button { color: var(--ink); background: var(--canvas); border-color: var(--canvas); }
.results button:hover:not(:disabled) { background: var(--surface-strong); border-color: var(--surface-strong); }

.guide {
  margin-top: 80px;
  padding: 74px 8.5%;
  background: var(--surface-soft);
  border-radius: 16px 16px 0 0;
}

.guide h2 { max-width: 820px; margin: 0; font-size: clamp(31px, 3.8vw, 47px); font-weight: 600; letter-spacing: -0.055em; line-height: 1.1; }
.guide h3 { margin: 38px 0 0; font-size: 21px; font-weight: 600; letter-spacing: -0.035em; }
.guide p { max-width: 850px; margin: 15px 0 0; color: var(--body); }
.guide ol { max-width: 800px; margin: 17px 0 0; padding-left: 22px; color: var(--body); }
.guide li + li { margin-top: 8px; }
.guide a, .sources a { color: var(--ink); font-weight: 600; text-decoration-color: #9ca3af; text-underline-offset: 3px; }

.sources {
  width: calc(100% + 0px);
  margin: 0;
  padding: 32px 8.5% 40px;
  color: #a1a1aa;
  background: var(--dark);
  font-size: 13px;
  line-height: 1.55;
}

.sources a { color: var(--canvas); text-decoration-color: #52525b; }

body.is-started .shell { padding-top: 8px; }
body.is-started .site-header { min-height: 50px; }
body.is-started .wordmark__badge { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
body.is-started .wordmark strong { font-size: 13px; }
body.is-started .wordmark small, body.is-started .site-header__link { display: none; }
body.is-started .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 20px 0; border-bottom: 0; }
body.is-started .eyebrow { display: none; }
body.is-started h1 { font-size: 25px; line-height: 1.08; }
body.is-started .lead { display: -webkit-box; margin-top: 5px; overflow: hidden; font-size: 13px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
body.is-started .score-card { display: flex; min-height: auto; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-soft); border-radius: 10px; white-space: nowrap; }
body.is-started .score-card::before, body.is-started .score-card__label { display: none; }
body.is-started .score-card strong { font-size: 22px; }
body.is-started .score-card span:last-child { font-size: 10px; }
body.is-started .toolbar { gap: 8px; margin: 0 0 14px; padding: 10px; }
body.is-started .toolbar__title { display: none; }
body.is-started label { gap: 3px; }
body.is-started select, body.is-started button, body.is-started .check { min-height: 38px; }
body.is-started select { height: 38px; }
body.is-started button { padding: 0 12px; }
body.is-started .check { padding: 0 9px; }
body.is-started .toolbar > * { width: auto; }
body.is-started .toolbar label:first-of-type { flex: 1 1 220px; }
body.is-started .guide { margin-top: 48px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1200px); }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 62px 2% 56px; }
  .score-card { min-height: 0; padding: 22px; }
  .toolbar { margin-top: 26px; }
  .toolbar > * { width: 100%; }
  select { width: 100%; }
  .check { justify-content: flex-start; }
  .question { padding: 32px 24px; }
  .guide { margin-top: 56px; padding: 52px 7%; }
  .results { padding: 28px 25px; }
  body.is-started .hero { grid-template-columns: 1fr; gap: 10px; padding: 15px 0; }
  body.is-started .score-card { justify-content: space-between; width: 100%; }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 20px, 1200px); }
  .site-header { min-height: 56px; }
  .site-header__link { display: none; }
  h1 { font-size: clamp(39px, 11vw, 49px); }
  .lead { font-size: 16px; }
  .toolbar { padding: 16px; }
  .question { padding: 28px 18px; }
  .question h2 { font-size: 27px; }
  .option { grid-template-columns: 30px 1fr; gap: 11px; min-height: 60px; padding: 12px; font-size: 15px; }
  .guide { padding: 45px 6%; }
  .guide h2 { font-size: 30px; }
  .guide h3 { font-size: 20px; }
  .sources { padding: 28px 6% 34px; }
}

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