/* Hallmark · page: vibe coding quiz (/vibe-coding-quiz), the full stamp is site.css · every question, answer, band and offer comes from content/quiz.json and content/offers.json */
/* Hallmark · dismissed 58 · the 81 words at the top of /vibe-coding-quiz are the h1, the intro, Start, the saving notice the contract requires and the ten one- to three-word question topics, a list scanned at a glance, not prose */
/* /vibe-coding-quiz. Page-only rules on top of site.css: tokens only, no new colours or sizes.
 * Without JavaScript every question is listed as a printable self-check; quiz.js adds .quiz--js and shows one at a time.
 * Wide screens set each question as a row: the prompt on the left five columns, the answers on the right. */

/* ---------- Head ---------- */
.quiz-head__aside { max-width: 52ch; margin-top: var(--space-md); color: var(--color-ink-2); }
.quiz-head__start { margin-top: var(--space-xl); }
.quiz-note { max-width: 52ch; margin-top: var(--space-md); color: var(--color-muted); font-size: var(--text-sm); line-height: 1.5; }
/* Before Start the head is the last thing in <main>, so it owns the bottom space. */
.page-head:has(+ .quiz[hidden]) { padding-bottom: var(--section-gap); }
/* What the questions cover: the ten topics in two columns under the way in, on a hairline. */
.quiz-topics { max-width: 44rem; margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.quiz-topics__list { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs) var(--gap-columns); color: var(--color-ink-2); }
@media (min-width: 30rem) { .quiz-topics__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Once it runs, the head is the h1 alone and the question sits a short step under it. */
.quiz-head--running + .quiz { padding-top: var(--space-2xl); }

/* ---------- Questions ---------- */
.quiz-list { margin: 0; padding: 0; list-style: none; border-top: var(--rule-hair) solid var(--color-rule); }
.quiz-q { padding-block: var(--space-xl); border-bottom: var(--rule-hair) solid var(--color-rule); }
/* .choices is a grid; here the legend floats beside the answers, which holds in every engine. */
.quiz-q__set { display: block; }
.quiz-q__legend { float: left; width: 100%; margin: 0 0 var(--space-lg); padding: 0; }
.quiz-q__legend:focus-visible { outline-offset: var(--space-xs); }
.quiz-q__count { display: block; margin-bottom: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; line-height: 1.5; }
.quiz-q__prompt { display: block; max-width: 34ch; color: var(--color-ink); font-family: var(--font-display); font-size: var(--text-title); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.3; text-wrap: pretty; }
.quiz-q__options { clear: both; grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); max-width: 44rem; }

/* An answer: the whole row is the target. Hover, press, focus, picked and disabled each read differently. */
.quiz-option { min-height: var(--control-h); padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
@media (hover: hover) {
  .quiz-option:hover { border-color: var(--color-muted); background: var(--color-paper-2); }
}
.quiz-option:active { transform: translateY(1px); }
.quiz-option:has(input:focus-visible) { border-color: var(--color-ink); }
.quiz-option:has(input:checked) { border-color: var(--color-ink); background: var(--color-paper-2); }
.quiz-option:has(input:disabled), .quiz-option:has(input:disabled):hover { border-color: var(--color-rule); background: var(--color-paper); transform: none; }

/* ---------- One at a time (quiz.js) ---------- */
/* The quiz holds a full screen, so the footer stays put while questions of different lengths come and go. */
.quiz--js { min-height: calc(100dvh - var(--head-h)); }
.quiz-form, .quiz-result { scroll-margin-top: var(--space-xl); }
.quiz--js .quiz-list { border-top: 0; }
.quiz--js .quiz-q { padding-block: 0; border-bottom: 0; }
/* Only when motion is welcome, so the Back step's own name never outranks the reduced-motion rule. */
@media (prefers-reduced-motion: no-preference) {
  .quiz--js .quiz-q { animation: quiz-step-next var(--dur-short) var(--ease-out); }
  .quiz--js[data-dir="back"] .quiz-q { animation-name: quiz-step-back; }
  .quiz-result { animation: quiz-step-next var(--dur-long) var(--ease-out); }
}
.quiz-nav { max-width: 44rem; margin-top: var(--space-xl); }
.quiz-nav__buttons { display: flex; justify-content: space-between; gap: var(--space-sm); }
.quiz-nav__hint { margin-top: var(--space-sm); }
/* The hint is a live region: it stays in the page while empty (site.css hides an empty .field__error), so a screen reader hears it when it fills. */
.quiz-nav .quiz-nav__hint:empty { display: block; }
@keyframes quiz-step-next { from { opacity: 0; transform: translateX(var(--space-lg)); } }
@keyframes quiz-step-back { from { opacity: 0; transform: translateX(calc(-1 * var(--space-lg))); } }

/* ---------- Result ---------- */
.quiz-result { display: grid; gap: var(--space-2xl); }
.quiz-result:focus-visible { outline-offset: var(--space-xs); }
.quiz-result__score { margin-top: var(--space-md); font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.2; }
.quiz-result__summary { margin-top: var(--space-lg); }
.quiz-result__part > h3 { margin-bottom: var(--space-lg); }
.quiz-result__part > .list { max-width: 65ch; }
.quiz-result__intro { max-width: 65ch; margin-bottom: var(--space-lg); color: var(--color-ink-2); }
.quiz-result__actions { margin-top: var(--space-xl); }

/* ---------- Answer key and bands: rows parted by hairlines ---------- */
.quiz-key { margin-top: var(--section-gap); }
.quiz-key__part + .quiz-key__part { margin-top: var(--space-2xl); }
.quiz-key__part > h3 { margin-bottom: var(--space-lg); }
.quiz-review, .quiz-bands { margin: 0; padding: 0; list-style: none; border-top: var(--rule-hair) solid var(--color-rule); }
.quiz-review__item, .quiz-bands__item { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-sm) var(--gap-columns); padding-block: var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-rule); }
.quiz-review__topic, .quiz-bands__title { margin: 0; font-family: var(--font-display); font-size: var(--text-title); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.2; }
.quiz-review__facts { display: grid; gap: var(--space-md); margin: 0; }
.quiz-review__facts dt { color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; line-height: 1.5; }
.quiz-review__facts dd { max-width: 65ch; margin: var(--space-3xs) 0 0; }
.quiz-bands__range { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.quiz-bands__say p { max-width: 65ch; margin-top: var(--space-xs); color: var(--color-ink-2); }

@media (min-width: 60.0625rem) {
  .quiz-q__legend { width: calc(100% * 5 / 12 - var(--gap-columns)); margin-bottom: 0; }
  .quiz-q__options { clear: none; margin-left: calc(100% * 5 / 12); }
  .quiz-nav { margin-left: calc(100% * 5 / 12); }
  .quiz-review__item, .quiz-bands__item { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .quiz-review__topic, .quiz-bands__range { grid-column: 1 / 6; }
  .quiz-review__facts, .quiz-bands__say { grid-column: 6 / -1; }
}
@media (max-width: 40rem) {
  .quiz-nav__buttons .btn, .quiz-head__start .btn { flex: 1 1 0; }
  .quiz-head--running + .quiz { padding-top: var(--space-xl); }
}

@media (prefers-reduced-motion: reduce) {
  .quiz--js .quiz-q, .quiz--js[data-dir="back"] .quiz-q, .quiz-result { animation: none; }
  .quiz-option { transition: background-color var(--dur-micro) linear, border-color var(--dur-micro) linear; }
  .quiz-option:active { transform: none; }
}

@media print {
  .quiz-q, .quiz-review__item, .quiz-bands__item { break-inside: avoid; }
}

/* The link from the result to the article on why these habits matter. */
.quiz-result__read { margin-top: var(--space-lg); color: var(--color-ink-2); }
