/* quiz-core.css — layout, type scale, animation, a11y. Colours via theme custom properties. */

/* ──────────────────────────────────────────────────────────────────────────
   Reset
   ────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ──────────────────────────────────────────────────────────────────────────
   Accessibility
   ────────────────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--quiz-color-focus, #0f81e8);
  outline-offset: 2px; border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* Headings/regions we move focus to for screen-reader context are tabindex="-1"
   and not interactive — never show a focus ring on them (fixes the box around
   the title-screen H1 on load, notably in Firefox). */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

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

/* ──────────────────────────────────────────────────────────────────────────
   Base + type scale
   ────────────────────────────────────────────────────────────────────────── */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100svh;
  font-family: var(--quiz-font-body);
  color: var(--quiz-color-text);
  background: var(--quiz-color-bg-outer, var(--quiz-color-bg));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }

/* Shared spacing rhythm */
:root {
  --gap-1: 0.5rem;
  --gap-2: 0.875rem;
  --gap-3: 1.25rem;
  --gap-4: 1.75rem;
  --gap-5: 2.5rem;
  --pad-x: 1.5rem;
  --content-max: 1180px;
  /* Entrance duration for the body swap between questions/screens. Bump this
     up if the question-to-question transition feels too quick (flickery). */
  --quiz-enter-dur: 1400ms;
  /* Chevron icon (used as a mask so it can be tinted via background-color) */
  --quiz-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}

/* ──────────────────────────────────────────────────────────────────────────
   Root + card shell
   ────────────────────────────────────────────────────────────────────────── */
#quiz-root {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.quiz-loading, .quiz-error {
  display: flex; align-items: center; justify-content: center;
  min-height: 100svh; padding: 2rem; text-align: center;
  font-size: 1.125rem; color: var(--quiz-color-text);
}

.quiz-card {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  width: 100%;
  background: var(--quiz-color-bg);
  position: relative;
  overflow: hidden;
}

/* Centre + frame the card on large screens so it never feels stretched */
@media (min-width: 1240px) {
  .quiz-card {
    max-width: var(--content-max);
    margin-inline: auto;
    border-inline: 1px solid var(--quiz-color-surface-border);
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Vertical transitions (was horizontal)
   ────────────────────────────────────────────────────────────────────────── */
@keyframes quiz-rise-in {
  from { opacity: 0; transform: translateY(44px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes quiz-rise-out {
  to { opacity: 0; transform: translateY(-28px); }
}
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-card--entering {
  animation: quiz-rise-in var(--quiz-enter-dur) cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Content-only entrance: animates the changing body while the header and
   footer stay anchored, so the footer doesn't flash out/in between screens. */
.quiz-content--entering {
  animation: quiz-rise-in var(--quiz-enter-dur) cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Progressive enhancement: if the renderer wraps swaps in a View Transition,
   the old card lifts up and the new card rises from below. */
.quiz-card { view-transition-name: quiz-card; }
::view-transition-old(quiz-card) { animation: 240ms cubic-bezier(0.4, 0, 1, 1) both quiz-rise-out; }
::view-transition-new(quiz-card) { animation: 420ms cubic-bezier(0.22, 1, 0.36, 1) both quiz-rise-in; }

/* ──────────────────────────────────────────────────────────────────────────
   Header (consistent across every screen)
   ────────────────────────────────────────────────────────────────────────── */
.quiz-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--pad-x);
  flex-shrink: 0; position: relative; z-index: 2;
  width: 100%; max-width: var(--content-max); margin-inline: auto;
}

/* Brand (top-left) — 350.org logo, links home */
.quiz-brand {
  display: inline-flex; align-items: center;
  text-decoration: none; flex-shrink: 0;
  border-radius: 8px;
  min-height: 44px; /* tap target */
}
.quiz-brand__logo {
  height: 32px; width: auto; display: block;
  border-radius: 5px; /* softens the blue badge corners */
}

/* Header external link (top-right) — 16px/700 to match 350.org's nav */
.quiz-header__link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--quiz-font-body);
  font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
  color: var(--quiz-color-link); text-decoration: none;
  min-height: 44px; padding: 0.4rem 0.25rem; /* tap target */
}
.quiz-header__link:hover { text-decoration: underline; }
.quiz-header__ext { font-size: 1.05em; }

/* Progress sub-bar (below header on question/reveal) */
.quiz-subbar {
  width: 100%; max-width: var(--content-max); margin-inline: auto;
  padding: 0.25rem var(--pad-x) 0.5rem;
  display: flex; justify-content: flex-end;
  flex-shrink: 0; position: relative; z-index: 2;
}
.quiz-progress { display: flex; align-items: center; gap: 0.875rem; }

/* PREVIOUS counter style — kept for easy revert:
.quiz-progress__counter {
  font-family: var(--quiz-font-mono);
  font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--quiz-color-primary);
  white-space: nowrap;
}
*/

/* Gamified counter — a big, popping current number to drive progress */
.quiz-progress__counter {
  display: inline-flex; align-items: baseline; gap: 0.05em;
  font-family: var(--quiz-font-display); white-space: nowrap; line-height: 1;
}
.quiz-progress__current {
  font-size: 1.875rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--quiz-color-primary);
  animation: count-pop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.quiz-progress__sep,
.quiz-progress__total {
  font-size: 1.125rem; font-weight: 700; color: var(--quiz-color-text-muted);
}
.quiz-progress__sep { margin: 0 0.04em; }
@keyframes count-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.55); }
  to   { opacity: 1; transform: none; }
}
.quiz-progress__dots { display: flex; gap: 6px; align-items: center; }
.quiz-progress__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--quiz-color-surface-border); flex-shrink: 0;
  transition: background 320ms ease, transform 320ms ease, width 320ms ease;
}
.quiz-progress__dot--done   { background: var(--quiz-color-primary); }
.quiz-progress__dot--active { background: var(--quiz-color-primary); width: 22px; border-radius: 99px; }

/* ──────────────────────────────────────────────────────────────────────────
   Card body + footer
   ────────────────────────────────────────────────────────────────────────── */
.quiz-card__body {
  flex: 1;
  display: flex; flex-direction: column;
  gap: var(--gap-3);
  padding: var(--gap-2) var(--pad-x) var(--gap-4);
  width: 100%; max-width: var(--content-max); margin-inline: auto;
  position: relative; z-index: 1;
}
.quiz-card__footer {
  padding: 0 var(--pad-x) 2rem;
  flex-shrink: 0; position: relative; z-index: 2;
  width: 100%; max-width: var(--content-max); margin-inline: auto;
}

/* Mobile: centre question/reveal content vertically so short cards aren't top-heavy */
.quiz-card--question .quiz-card__body,
.quiz-card--reveal   .quiz-card__body {
  justify-content: center;
}

/* Desktop: two columns — prompt left, answers right */
@media (min-width: 1024px) {
  .quiz-card--question .quiz-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-5);
    align-items: center;
    padding-inline: 4rem;
  }

  /* Reveal keeps the answer list in the SAME right-hand column as the question
     screen (no horizontal flip). Prompt sits top-left, the reveal panel below
     it, and the answered options stay pinned right, spanning both rows. */
  .quiz-card--reveal .quiz-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "prompt options"
      "reveal options"
      "next   next";
    grid-template-rows: auto auto auto;
    gap: var(--gap-3) var(--gap-5);
    align-content: center;
    align-items: start;
    padding-inline: 4rem;
  }
  .quiz-card--reveal .quiz-reveal-prompt   { grid-area: prompt; }
  .quiz-card--reveal .quiz-options--answered { grid-area: options; align-self: center; }
  .quiz-card--reveal .quiz-reveal          { grid-area: reveal; }
  /* Next button sits on its own full-width row below both columns */
  .quiz-card--reveal .quiz-reveal-next     {
    grid-area: next;
    width: auto;
    justify-self: end;
    min-width: 360px;
    padding-inline: 2.75rem;
    margin-top: var(--gap-2);
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Columns
   ────────────────────────────────────────────────────────────────────────── */
.quiz-col--left  { display: flex; flex-direction: column; gap: var(--gap-3); position: relative; }
.quiz-col--right { display: flex; flex-direction: column; gap: var(--gap-2); }

/* Question index — hidden for now (redundant with the prominent progress
   counter, which already highlights the question number). Set display back to
   `block` to reinstate the big editorial number on question/reveal screens. */
.quiz-q-num {
  display: none;
  font-family: var(--quiz-font-display);
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-weight: 900; line-height: 0.9; letter-spacing: -0.03em;
  color: var(--quiz-color-primary);
  opacity: 0.18;
  user-select: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   Intro
   ────────────────────────────────────────────────────────────────────────── */
/* Full-bleed hero image with a strong brand gradient for text legibility */
.quiz-intro__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
/* Dark #17292E scrim (matches 350.org's .bg-on) — darkens for legible text
   without the blue cast washing out the photograph */
.quiz-card--intro::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(23, 41, 46, 0.40) 0%,
    rgba(23, 41, 46, 0.62) 50%,
    rgba(23, 41, 46, 0.88) 100%);
}
.quiz-card--intro .quiz-header,
.quiz-card--intro .quiz-card__body,
.quiz-card--intro .quiz-card__footer,
.quiz-card--intro .quiz-sitefooter { position: relative; z-index: 2; }
.quiz-card--intro .quiz-card__body { justify-content: center; }

.quiz-intro__content {
  display: flex; flex-direction: column; gap: var(--gap-3);
  position: relative; z-index: 2;
  max-width: 880px;
}
.quiz-intro__text { display: flex; flex-direction: column; gap: var(--gap-3); }

/* Desktop: campaign lockup sits to the RIGHT of the text (image is first in the
   DOM, so row-reverse keeps it above the text on mobile and right on desktop) */
@media (min-width: 768px) {
  .quiz-intro__content {
    flex-direction: row-reverse; align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem); max-width: 1120px;
  }
  .quiz-intro__text { flex: 1; }
  .quiz-intro__campaign { flex-shrink: 0; }
}
.quiz-intro__eyebrow {
  font-family: var(--quiz-font-mono);
  font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
}
/* Campaign title lockup (The Great Power Shift sticker) */
.quiz-intro__campaign {
  width: auto; height: auto;
  max-width: min(320px, 80%); max-height: 160px;
  object-fit: contain;
  margin-bottom: 0.25rem;
  align-self: center; /* centred on mobile (column); harmless on desktop row */
}
@media (min-width: 1024px) {
  .quiz-intro__campaign { max-width: 420px; max-height: 220px; }
}
.quiz-intro__headline {
  font-family: var(--quiz-font-display);
  font-size: clamp(2.75rem, 7.5vw, 5.25rem);
  font-weight: 900; line-height: 1.0; letter-spacing: -0.035em;
}
.quiz-intro__body {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.6; max-width: 40ch; font-weight: 400;
}

/* ──────────────────────────────────────────────────────────────────────────
   Question prompt + answered prompt
   ────────────────────────────────────────────────────────────────────────── */
.quiz-question__image {
  width: 100%; border-radius: 16px; object-fit: cover;
  max-height: 260px;
}
@media (min-width: 1024px) {
  .quiz-question__image { max-height: 340px; }
}

.quiz-question__text {
  font-family: var(--quiz-font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.025em;
  color: var(--quiz-color-text);
}
.quiz-question__text--answered {
  font-size: clamp(1.0625rem, 1.8vw, 1.375rem);
  font-weight: 600; line-height: 1.3; color: var(--quiz-color-text-muted);
}

/* ──────────────────────────────────────────────────────────────────────────
   Options
   ────────────────────────────────────────────────────────────────────────── */
.quiz-options { display: flex; flex-direction: column; gap: var(--gap-2); }

/* Gamified option — circular colour badge, lift on hover, arrow reveal */
.quiz-option {
  display: flex; align-items: center; gap: 0.875rem;
  width: 100%; min-height: 74px; padding: 0.875rem 1rem 0.875rem 0.875rem;
  background: var(--quiz-color-bg);
  color: var(--quiz-color-text);
  border: 2px solid var(--quiz-color-surface-border);
  border-radius: 16px;
  font-family: var(--quiz-font-body);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 150ms cubic-bezier(0.34,1.56,0.64,1);
}
.quiz-option__text { flex: 1; }

/* Circular, filled letter badge */
.quiz-option__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--quiz-color-primary); color: #fff;
  font-family: var(--quiz-font-display);
  font-size: 1.125rem; font-weight: 800; line-height: 1;
  transition: transform 160ms cubic-bezier(0.34,1.56,0.64,1), background 160ms ease;
}

/* "Pick me" SVG chevron that slides in on hover/focus.
   Uses a mask so it inherits the brand colour via background. */
.quiz-option::after {
  content: ''; flex-shrink: 0;
  width: 22px; height: 22px;
  background-color: var(--quiz-color-primary);
  -webkit-mask: var(--quiz-chevron) no-repeat center / 22px 22px;
          mask: var(--quiz-chevron) no-repeat center / 22px 22px;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.quiz-option:hover:not(:disabled),
.quiz-option:focus-visible {
  border-color: var(--quiz-color-primary);
  background: var(--quiz-color-surface-hover);
  transform: translateY(-2px);
}
.quiz-option:hover:not(:disabled) .quiz-option__badge,
.quiz-option:focus-visible .quiz-option__badge { transform: scale(1.12); }
.quiz-option:hover:not(:disabled)::after,
.quiz-option:focus-visible::after { opacity: 1; transform: translateX(0); }
.quiz-option:active:not(:disabled) { transform: scale(0.98); }

/* Answered options: no hover arrow, no lift */
.quiz-options--answered .quiz-option::after { display: none; }

.quiz-options--answered { pointer-events: none; }
.quiz-option__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  font-size: 0.9375rem; font-weight: 900; line-height: 1;
  background: rgba(255,255,255,0.25); color: #fff;
}

/* Answered states — solid fills so the responses are bold and unmistakable */
.quiz-option--selected-correct {
  background: var(--quiz-color-correct); border-color: var(--quiz-color-correct);
  color: #fff; font-weight: 700;
}
/* Wrong pick — light/subdued so it doesn't compete with the green correct answer */
.quiz-option--selected-incorrect {
  background: var(--quiz-color-incorrect-subtle); border-color: var(--quiz-color-incorrect);
  color: var(--quiz-color-incorrect); font-weight: 700;
}
.quiz-option--selected-correct .quiz-option__badge {
  background: rgba(255,255,255,0.22); color: #fff;
}
.quiz-option--selected-incorrect .quiz-option__badge,
.quiz-option--selected-incorrect .quiz-option__icon {
  background: var(--quiz-color-incorrect); color: #fff;
}

/* The right answer, when the user picked something else: strong green outline */
.quiz-option--correct-answer {
  border-color: var(--quiz-color-correct);
  color: var(--quiz-color-correct-text, var(--quiz-color-text));
  background: var(--quiz-color-correct-subtle); font-weight: 700;
}
.quiz-option--correct-answer .quiz-option__badge { background: var(--quiz-color-correct); color: #fff; }
.quiz-option--correct-answer .quiz-option__icon  { background: var(--quiz-color-correct); color: #fff; }

.quiz-option--neutral { opacity: 0.55; }
.quiz-option--neutral .quiz-option__badge { background: var(--quiz-color-surface); color: var(--quiz-color-text-muted); }

/* ──────────────────────────────────────────────────────────────────────────
   Reveal
   ────────────────────────────────────────────────────────────────────────── */
.quiz-reveal {
  background: var(--quiz-color-surface);
  border-radius: 18px;
  padding: var(--gap-3) var(--gap-3);
  display: flex; flex-direction: column; gap: var(--gap-2);
}
.quiz-reveal--entering { animation: reveal-rise var(--quiz-enter-dur) 80ms cubic-bezier(0.22, 1, 0.36, 1) both; }

.quiz-feedback { display: flex; align-items: center; gap: 0.625rem; }
.quiz-feedback__icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; flex-shrink: 0; line-height: 1; color: #fff;
}
.quiz-feedback--correct   .quiz-feedback__icon  { background: var(--quiz-color-correct); }
.quiz-feedback--incorrect .quiz-feedback__icon  { background: var(--quiz-color-incorrect); }
.quiz-feedback__label {
  font-family: var(--quiz-font-display);
  font-size: 1.25rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.quiz-feedback--correct   .quiz-feedback__label { color: var(--quiz-color-correct); }
.quiz-feedback--incorrect .quiz-feedback__label { color: var(--quiz-color-incorrect); }

.quiz-reveal__body { display: flex; flex-direction: column; gap: var(--gap-1); }
.quiz-reveal__image { width: auto; max-width: 100%; border-radius: 12px; max-height: 420px; object-fit: contain; display: block; margin: 0 auto; }
.quiz-reveal__text {
  font-size: clamp(1.125rem, 1.7vw, 1.4375rem);
  line-height: 1.55; color: var(--quiz-color-text); font-weight: 500;
  white-space: pre-line;
}
/* Source indication — one consistent style everywhere it appears */
.quiz-reveal__source,
.quiz-slide__source {
  font-family: var(--quiz-font-mono);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--quiz-color-source);
}
/* The citation list itself: normal case/weight and readable size, since it
   now often holds multiple numbered, linked references rather than one
   short label. Sits on its own line below the "Sources:" tag above. */
.quiz-reveal__source-list {
  display: block; margin-top: 0.35rem;
  font-family: var(--quiz-font-body, inherit);
  font-size: 0.8125rem; font-weight: 500;
  letter-spacing: normal; text-transform: none;
  line-height: 1.5; white-space: pre-line;
  color: var(--quiz-color-text-muted);
}
.quiz-reveal__text a,
.quiz-batch__reveal a,
.quiz-score__body a,
.quiz-nudge__body a,
.quiz-learn-more__body a,
.quiz-reveal__source-list a {
  color: var(--quiz-color-primary); text-decoration: underline;
  text-underline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────────────────────────────────── */
.quiz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 60px; padding: 0.875rem 2rem;
  border: 2px solid transparent; border-radius: 14px;
  font-family: var(--quiz-font-display);
  font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 120ms ease;
}
.quiz-btn:active { transform: scale(0.98); }
.quiz-btn--full { width: 100%; }

.quiz-btn--primary {
  background: var(--quiz-color-primary); color: #fff; border-color: var(--quiz-color-primary);
}
.quiz-btn--primary:hover {
  background: var(--quiz-color-primary-dark); border-color: var(--quiz-color-primary-dark);
}

.quiz-btn--petition {
  background: var(--quiz-color-primary); color: #fff; border-color: var(--quiz-color-primary);
  min-height: 64px; font-size: 1.25rem;
}
.quiz-btn--petition:hover { background: var(--quiz-color-primary-dark); }

.quiz-btn--share {
  background: transparent; color: var(--quiz-color-link);
  border-color: var(--quiz-color-surface-border);
  min-height: 46px; padding: 0.5rem 1.25rem; font-size: 1rem; align-self: flex-start;
}
.quiz-btn--share:hover { background: var(--quiz-color-surface-hover); border-color: var(--quiz-color-primary); }

.quiz-btn--ghost {
  background: transparent; color: var(--quiz-color-text-muted);
  border-color: transparent; font-size: 1rem; min-height: 52px;
}
.quiz-btn--ghost:hover { color: var(--quiz-color-text); }

.quiz-card--intro .quiz-btn--primary { min-height: 64px; font-size: 1.25rem; }

/* ── Reveal "Next" — mirrors the answer options' hover behaviour ── */
.quiz-reveal-next {
  width: 100%;                       /* full-width on mobile; auto on desktop */
  min-height: 68px;
  font-size: 1.375rem;
  border-radius: 18px;
  gap: 0.55rem;
  transition: background 180ms ease, border-color 180ms ease,
              transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Arrow stays tucked away until hover/focus, then slides in — like the options' chevron */
.quiz-reveal-next::after {
  content: ''; flex-shrink: 0;
  width: 26px; height: 26px;
  background-color: currentColor;
  -webkit-mask: var(--quiz-chevron) no-repeat center / contain;
          mask: var(--quiz-chevron) no-repeat center / contain;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
/* No upward lift on hover — the arrow slide-in is the affordance, on hover and
   focus alike, matching how the answer options reveal their chevron. */
.quiz-reveal-next:hover::after,
.quiz-reveal-next:focus-visible::after { opacity: 1; transform: translateX(0); }
.quiz-reveal-next:active { transform: scale(0.98); }

/* ──────────────────────────────────────────────────────────────────────────
   Results
   ────────────────────────────────────────────────────────────────────────── */
.quiz-card--results .quiz-card__body { gap: 0; padding-bottom: 3rem; }

/* Shared section titles — blue, sentence case (used by score + discovered) */
.quiz-section-title {
  font-family: var(--quiz-font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -0.025em;
  color: var(--quiz-color-primary);
}

/* ── Score hero — gamified, with donut chart. Block centred, detail text left ── */
.quiz-score-section {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--gap-3);
  padding: var(--gap-3) 0 var(--gap-5);
}
.quiz-score {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--gap-3);
}
@media (min-width: 600px) {
  .quiz-score { flex-direction: row; align-items: center; justify-content: center; gap: var(--gap-4); }
}
.quiz-score__detail { text-align: left; }

.quiz-donut-wrap {
  position: relative; width: 152px; height: 152px; flex-shrink: 0;
}
.quiz-donut { width: 100%; height: 100%; display: block; }
.quiz-donut__track {
  fill: none; stroke: var(--quiz-color-surface-border); stroke-width: 12;
}
.quiz-donut__value {
  fill: none; stroke: var(--quiz-color-correct); stroke-width: 12; stroke-linecap: round;
  animation: donut-draw 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes donut-draw {
  from { stroke-dashoffset: var(--dash); }
  to   { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-donut__value { animation: none; }
}
.quiz-donut__label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
/* Score shown as a clear "N / M" fraction so the total is never lost */
.quiz-donut__score {
  display: inline-flex; align-items: baseline;
  font-family: var(--quiz-font-display); line-height: 1;
}
.quiz-donut__num {
  font-size: 2.875rem; font-weight: 900; letter-spacing: -0.03em;
}
.quiz-donut__total {
  font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--quiz-color-text);
}
.quiz-donut__caption {
  font-family: var(--quiz-font-mono);
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--quiz-color-text-muted);
  margin-top: 0.35rem;
}

.quiz-score__detail { max-width: 46ch; }

.quiz-score__verdict {
  font-family: var(--quiz-font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900; line-height: 1.0; letter-spacing: -0.035em;
  color: var(--quiz-color-text); margin-bottom: var(--gap-1);
}
.quiz-score__body {
  font-size: clamp(1.3125rem, 1.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.6; color: var(--quiz-color-text-muted);
}
.quiz-score__body--correct   { color: var(--quiz-color-correct-text, var(--quiz-color-correct)); }
.quiz-score__body--incorrect { color: var(--quiz-color-incorrect); }

/* ── Discovered section — visually separated from the score hero ── */
.quiz-reveals {
  display: flex; flex-direction: column; gap: var(--gap-3);
  padding-top: var(--gap-5);
  border-top: 2px solid var(--quiz-color-surface-border);
}

/* Action sits apart with its own breathing room */
.quiz-card--results .quiz-action { margin-top: var(--gap-5); }

/* ── Sharing carousel — one card containing the slides AND the nav ── */
.quiz-carousel {
  display: flex; flex-direction: column; gap: var(--gap-3);
  background: var(--quiz-color-surface);
  border: 1px solid var(--quiz-color-surface-border);
  border-radius: 18px;
  padding: var(--gap-4);
}
.quiz-carousel__viewport { overflow: hidden; }
.quiz-carousel__track {
  display: flex;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .quiz-carousel__track { transition: none; }
}

/* Slides are now bare content — the carousel card provides the surface */
.quiz-slide {
  flex: 0 0 100%; min-width: 100%;
  display: flex; flex-direction: column; gap: var(--gap-2);
}
.quiz-slide__fact {
  font-family: var(--quiz-font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.875rem);
  font-weight: 700; line-height: 1.3; letter-spacing: -0.015em;
  color: var(--quiz-color-text);
}
.quiz-slide .quiz-btn--share { align-self: flex-start; margin-top: 0.375rem; }

/* Nav: arrows + position indicator — separated from the slide by a hairline */
.quiz-carousel__nav {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  padding-top: var(--gap-3);
  border-top: 1px solid var(--quiz-color-surface-border);
}
.quiz-carousel__arrow {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--quiz-color-bg);
  border: 2px solid var(--quiz-color-surface-border);
  color: var(--quiz-color-primary);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}
.quiz-carousel__arrow svg { display: block; }
.quiz-carousel__arrow:hover:not(:disabled) {
  border-color: var(--quiz-color-primary);
  background: var(--quiz-color-surface-hover);
}
.quiz-carousel__arrow:disabled { opacity: 0.3; cursor: default; }

.quiz-carousel__indicator { display: flex; flex-direction: column; align-items: center; gap: 0.625rem; }
.quiz-carousel__dots { display: flex; align-items: center; gap: 6px; }
.quiz-carousel__dot {
  width: 36px; height: 44px; padding: 0; border: none; background: transparent;
  cursor: pointer; position: relative; flex-shrink: 0;
}
.quiz-carousel__dot::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 99px;
  background: var(--quiz-color-surface-border);
  transition: background 220ms ease, width 220ms ease;
}
.quiz-carousel__dot:hover::before { background: var(--quiz-color-primary); }
.quiz-carousel__dot--active::before { background: var(--quiz-color-primary); width: 32px; }

.quiz-carousel__count {
  font-family: var(--quiz-font-mono);
  font-size: 1rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--quiz-color-text);
}

/* Action / petition */
.quiz-action {
  background: var(--quiz-color-primary); border-radius: 20px;
  padding: var(--gap-5) var(--gap-3);
  display: flex; flex-direction: column; gap: var(--gap-2); text-align: center;
}
.quiz-action__headline {
  font-family: var(--quiz-font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 900;
  line-height: 1.05; letter-spacing: -0.03em; color: #fff;
}
.quiz-action__body { font-size: 1.125rem; line-height: 1.6; color: rgba(255,255,255,0.85); max-width: 46ch; margin-inline: auto; }
.quiz-action .quiz-btn--petition { background: #fff; color: var(--quiz-color-primary); border-color: #fff; margin-top: var(--gap-1); }
.quiz-action .quiz-btn--petition:hover { background: rgba(255,255,255,0.9); }
.quiz-action .quiz-btn--ghost { color: rgba(255,255,255,0.72); }
.quiz-action .quiz-btn--ghost:hover { color: #fff; }

/* Outline button — secondary CTA (e.g. learn more) */
.quiz-btn--outline {
  background: transparent; color: var(--quiz-color-link);
  border-color: var(--quiz-color-primary);
}
.quiz-btn--outline:hover { background: var(--quiz-color-surface-hover); }

/* Learn-more block — a calmer, secondary next step below the petition CTA */
.quiz-learn-more {
  margin-top: var(--gap-4);
  padding: var(--gap-4) var(--gap-3);
  border: 2px solid var(--quiz-color-surface-border);
  border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; gap: var(--gap-2);
  text-align: center;
}
/* Headline + body sized to match the petition ("Help shift the power") block */
.quiz-learn-more__headline {
  font-family: var(--quiz-font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900; line-height: 1.05; letter-spacing: -0.03em;
  color: var(--quiz-color-text);
}
.quiz-learn-more__body {
  font-size: 1.125rem; line-height: 1.6;
  color: var(--quiz-color-text-muted); max-width: 48ch;
}
.quiz-learn-more .quiz-btn--outline { margin-top: var(--gap-1); }

/* ──────────────────────────────────────────────────────────────────────────
   Stepped outro (nudge → petition → results → share), one block per screen
   ────────────────────────────────────────────────────────────────────────── */
/* Centre the short steps; let the long share step flow from the top */
.quiz-card--outro .quiz-card__body {
  justify-content: center;
  gap: var(--gap-3);
  padding-bottom: var(--gap-5);
}
.quiz-card--outro[data-outro-step="3"] .quiz-card__body {
  justify-content: flex-start;
  padding-top: var(--gap-3);
}

.quiz-outro-step {
  display: flex; flex-direction: column; gap: var(--gap-4);
  width: 100%;
}
/* Directional slide: forward rises from below, Back drops from above */
@keyframes outro-rise { from { opacity: 0; transform: translateY(46px); } to { opacity: 1; transform: none; } }
@keyframes outro-drop { from { opacity: 0; transform: translateY(-46px); } to { opacity: 1; transform: none; } }
.quiz-outro-step--forward { animation: outro-rise var(--quiz-enter-dur) cubic-bezier(0.22, 1, 0.36, 1) both; }
.quiz-outro-step--back    { animation: outro-drop var(--quiz-enter-dur) cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Stepper bar — Back affordance left, progress dots right */
.quiz-subbar--outro { justify-content: space-between; align-items: center; gap: 1rem; min-height: 60px; }
.quiz-stepper__spacer { display: inline-block; }
/* Back is a clear pill — more prominent than a plain link, lighter than a CTA */
.quiz-stepper__back {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 44px; padding: 0.45rem 1.1rem 0.45rem 0.8rem;
  background: var(--quiz-color-surface);
  border: 1.5px solid var(--quiz-color-surface-border);
  border-radius: 99px; cursor: pointer;
  font-family: var(--quiz-font-display); font-size: 1.0625rem; font-weight: 700;
  color: var(--quiz-color-link);
  transition: border-color 160ms ease, background 160ms ease, transform 140ms ease;
}
.quiz-stepper__back svg { width: 20px; height: 20px; }
.quiz-stepper__back:hover { border-color: var(--quiz-color-primary); background: var(--quiz-color-surface-hover); }
.quiz-stepper__back:active { transform: scale(0.97); }
.quiz-stepper__dots { display: flex; align-items: center; gap: 7px; }
.quiz-stepper__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--quiz-color-surface-border);
  transition: width 280ms ease, background 280ms ease;
}
.quiz-stepper__dot--done   { background: var(--quiz-color-primary); opacity: 0.45; }
.quiz-stepper__dot--active { background: var(--quiz-color-primary); width: 26px; border-radius: 99px; }

/* Step 0 — nudge. Yes dominant, No quiet. */
.quiz-nudge {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--gap-3); max-width: 660px; margin-inline: auto; padding: var(--gap-3) 0;
}
.quiz-nudge__headline {
  font-family: var(--quiz-font-display);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 900; line-height: 1.0; letter-spacing: -0.035em;
  color: var(--quiz-color-text);
}
.quiz-nudge__body {
  font-size: clamp(1.125rem, 2vw, 1.4375rem); line-height: 1.55;
  color: var(--quiz-color-text-muted); max-width: 40ch;
  white-space: pre-line;
}
.quiz-nudge__actions {
  display: flex; flex-direction: column; gap: var(--gap-2);
  width: 100%; max-width: 380px; margin-top: var(--gap-2);
}
.quiz-nudge__yes { min-height: 66px; font-size: 1.3125rem; }

/* Score reveal CTA — centred below the score (and the batch recap, if shown) */
.quiz-outro-cta { margin-top: var(--gap-3); width: min(100%, 340px); align-self: center; }

/* Batch mode — question-by-question recap shown with the score */
.quiz-batch-section { display: flex; flex-direction: column; gap: var(--gap-3); }
.quiz-batch {
  list-style: none; display: flex; flex-direction: column; gap: var(--gap-2);
}
.quiz-batch__item {
  background: var(--quiz-color-surface);
  border: 1.5px solid var(--quiz-color-surface-border);
  border-left-width: 5px;
  border-radius: 14px;
  padding: var(--gap-3);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.quiz-batch__item--correct   { border-left-color: var(--quiz-color-correct); }
.quiz-batch__item--incorrect { border-left-color: var(--quiz-color-incorrect); }
.quiz-batch__head { display: flex; align-items: flex-start; gap: 0.7rem; }
/* Attractive editorial question number — big, bold, brand blue */
.quiz-batch__num {
  flex-shrink: 0; align-self: flex-start;
  font-family: var(--quiz-font-display);
  font-size: 1.75rem; font-weight: 900; line-height: 1;
  letter-spacing: -0.03em; color: var(--quiz-color-primary);
  font-variant-numeric: tabular-nums;
}
.quiz-batch__icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 0.85rem; line-height: 1;
}
.quiz-batch__image {
  width: auto; max-width: 100%; border-radius: 12px; max-height: 420px; object-fit: contain;
  display: block; margin: 0 auto;
}
.quiz-batch__item--correct   .quiz-batch__icon { background: var(--quiz-color-correct); }
.quiz-batch__item--incorrect .quiz-batch__icon { background: var(--quiz-color-incorrect); }
.quiz-batch__q {
  flex: 1;
  font-family: var(--quiz-font-display); font-weight: 700;
  font-size: 1.125rem; line-height: 1.25; color: var(--quiz-color-text);
}
.quiz-batch__answer { font-size: 0.95rem; line-height: 1.5; color: var(--quiz-color-text-muted); }
.quiz-batch__tag { font-weight: 700; color: var(--quiz-color-text); }
.quiz-batch__given--correct {
  color: var(--quiz-color-correct-text, var(--quiz-color-correct)); font-weight: 600;
  font-size: calc(0.95rem + 4px);
}
.quiz-batch__right {
  display: block; color: var(--quiz-color-correct-text, var(--quiz-color-correct)); font-weight: 600;
  font-size: calc(0.95rem + 4px);
}
.quiz-batch__reveal { font-size: 1.0625rem; line-height: 1.5; color: var(--quiz-color-text); white-space: pre-line; }

/* Step 3 — share + learn-more (no divider; it leads the step) */
.quiz-reveals--step { border-top: none; padding-top: 0; }
.quiz-reveals__intro {
  font-size: 1.0625rem; line-height: 1.5; color: var(--quiz-color-text-muted);
}
.quiz-outro-restart { margin-top: var(--gap-2); }

/* ──────────────────────────────────────────────────────────────────────────
   Share overlay
   ────────────────────────────────────────────────────────────────────────── */
.quiz-share-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .quiz-share-overlay { align-items: center; } }
.quiz-share-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(23, 41, 46, 0.55); backdrop-filter: blur(4px);
}
@keyframes panel-up { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: translateY(0); } }
.quiz-share-panel {
  position: relative; z-index: 1;
  background: var(--quiz-color-bg);
  border-radius: 22px 22px 0 0;
  padding: 2rem var(--pad-x) calc(2rem + env(safe-area-inset-bottom));
  width: 100%; max-width: 560px;
  animation: panel-up 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
  display: flex; flex-direction: column; gap: var(--gap-3);
  border-top: 1px solid var(--quiz-color-surface-border);
}
@media (min-width: 640px) { .quiz-share-panel { border-radius: 22px; padding: 2.5rem; } }
.quiz-share-panel__close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--quiz-color-surface); border: none; border-radius: 50%;
  cursor: pointer; font-size: 1rem; color: var(--quiz-color-text);
  transition: background 180ms ease, color 180ms ease;
}
.quiz-share-panel__close:hover { background: var(--quiz-color-incorrect); color: #fff; }
.quiz-share-panel__heading {
  font-family: var(--quiz-font-display); font-size: 1.5rem; font-weight: 800;
  color: var(--quiz-color-text); padding-right: 3rem;
}
.quiz-share-panel__stat {
  font-size: 1.0625rem; line-height: 1.6; color: var(--quiz-color-text);
  border-left: 4px solid var(--quiz-color-primary); padding-left: 1rem; font-weight: 500;
}
.quiz-share-panel__platforms { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.quiz-share-btn {
  min-height: 48px; padding: 0.625rem 1.25rem; border-radius: 14px;
  background: var(--quiz-color-surface); border: 2px solid var(--quiz-color-surface-border);
  color: var(--quiz-color-text); font-family: var(--quiz-font-display);
  font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.quiz-share-btn:hover { border-color: var(--quiz-color-primary); background: var(--quiz-color-surface-hover); }
.quiz-share-btn--native {
  width: 100%; background: var(--quiz-color-primary);
  border-color: var(--quiz-color-primary); color: #fff; min-height: 56px; font-size: 1.0625rem;
}
.quiz-share-btn--native:hover { background: var(--quiz-color-primary-dark); border-color: var(--quiz-color-primary-dark); }
.quiz-share-status {
  font-family: var(--quiz-font-mono); font-size: 0.8125rem;
  color: var(--quiz-color-correct); min-height: 1.2em; letter-spacing: 0.05em; text-transform: uppercase;
}

/* ──────────────────────────────────────────────────────────────────────────
   Site footer (all screens)
   ────────────────────────────────────────────────────────────────────────── */
/* Dark #17292E band on every screen, mirroring 350.org's footer */
.quiz-sitefooter {
  flex-shrink: 0; position: relative; z-index: 2;
  width: 100%; margin-top: auto;
  background: var(--quiz-color-dark, #17292e);
  color: #ffffff;
  padding: var(--gap-4) var(--pad-x) calc(var(--gap-4) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 0.5rem;
}
.quiz-sitefooter__nav {
  display: flex; flex-wrap: wrap; gap: 0 1.5rem;
}
.quiz-sitefooter__link {
  display: inline-flex; align-items: center; min-height: 44px; /* tap target */
  font-family: var(--quiz-font-body);
  font-size: 1rem; font-weight: 600;
  color: rgba(255, 255, 255, 0.92); text-decoration: none;
}
.quiz-sitefooter__link:hover { color: #fff; text-decoration: underline; }
.quiz-sitefooter__copy {
  font-family: var(--quiz-font-body);
  font-size: 0.8125rem; font-weight: 400; line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

/* ──────────────────────────────────────────────────────────────────────────
   Responsive padding
   ────────────────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  :root { --pad-x: 2.5rem; }
}
@media (min-width: 1024px) {
  :root { --pad-x: 4rem; }
}
